Re: Castle Windsor under medium trust

2013-05-17 Thread Allan Fagner
Hi all,

Sorry push on this again but I've been struggling to run Windsor in medium 
trust for over a month and so far I did not have any luck. Every time I 
overcome a problem a new one shows up in never ending chain. I also did not 
find a reliable source that could help solving that. It feels like 
I'm fighting a battle I have lost already. I also did not find a reliable 
source that could.

So, if this list could not help running Windsor in medium trust I feel like 
I'll have to give up on it and try a different approach. Though I do not 
want to do that.

Could some one help me with that and give me an actual Windsor 
implementation that works on medium trust? I have tried every change I 
could think of in the source code and I'd really appreciate if I could get 
working code.

Thanks

Em quarta-feira, 1 de maio de 2013 16h53min25s UTC-3, Allan Fagner escreveu:

 Hi guys,

 I'm new to Windsor and I'm trying to run it under medium trust. I've 
 researched old discussion about that but did not have any luck doing what 
 the old conversations suggest. I'm getting the following error while trying 
 to create an new instance of WindsorContainer:

 *Inheritance security rules violated while overriding member: 
 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security 
 accessibility of the overriding method must match the security 
 accessibility of the method being overriden.*
 *
 *
 I noticed there are build options but did not understand what parameter I 
 should be passing in in order to build a version that works on medium trust.

 Can anyone help me with that?

 Thanks

 Allan


-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Castle Windsor under medium trust

2013-05-17 Thread hammett
Starting in .net 4, all assemblies should be security transparent by
default, so they should work on medium trust - unless they do
something unsafe, in this case they need to be mixed.

Worst case scenario it needs to be APTCA and SecurityCritical, but I
had way more success not opt-in for a particular security and letting
the framework figure it out itself.




On Fri, May 17, 2013 at 7:50 AM, Allan Fagner allanfag...@gmail.com wrote:
 Hi all,

 Sorry push on this again but I've been struggling to run Windsor in medium
 trust for over a month and so far I did not have any luck. Every time I
 overcome a problem a new one shows up in never ending chain. I also did not
 find a reliable source that could help solving that. It feels like I'm
 fighting a battle I have lost already. I also did not find a reliable source
 that could.

 So, if this list could not help running Windsor in medium trust I feel like
 I'll have to give up on it and try a different approach. Though I do not
 want to do that.

 Could some one help me with that and give me an actual Windsor
 implementation that works on medium trust? I have tried every change I could
 think of in the source code and I'd really appreciate if I could get working
 code.

 Thanks

 Em quarta-feira, 1 de maio de 2013 16h53min25s UTC-3, Allan Fagner escreveu:

 Hi guys,

 I'm new to Windsor and I'm trying to run it under medium trust. I've
 researched old discussion about that but did not have any luck doing what
 the old conversations suggest. I'm getting the following error while trying
 to create an new instance of WindsorContainer:

 Inheritance security rules violated while overriding member:
 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security
 accessibility of the overriding method must match the security accessibility
 of the method being overriden.


 I noticed there are build options but did not understand what parameter I
 should be passing in in order to build a version that works on medium trust.

 Can anyone help me with that?

 Thanks

 Allan

 --
 You received this message because you are subscribed to the Google Groups
 Castle Project Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to castle-project-users+unsubscr...@googlegroups.com.
 To post to this group, send email to castle-project-users@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/castle-project-users?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
Cheers,
hammett
http://www.d-collab.com/
http://hammett.castleproject.org/

-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Castle Windsor under medium trust

2013-05-03 Thread Allan Fagner
hammett,

I did what you suggested and than got this error:

MethodAccessException
Attempt by security transparent method 
'Castle.Core.Internal.PermissionUtil.IsGranted(System.Security.IPermission)' 
to access security critical method 'System.AppDomain.get_PermissionSet()' 
failed.

on this line

return permissionSet.IsSubsetOf(AppDomain.CurrentDomain.PermissionSet)


of this method


PermissionUtil.IsGranted(IPermission)


Any further tip?

Em quinta-feira, 2 de maio de 2013 22h06min00s UTC-3, hammett escreveu:

 is this the only error?

 I think it's safe to remove these overrides to InitializeLifetimeService 
 since I think they just kill the default remoting lease (rarely need, just 
 when using windsor through remoting)


 On Wed, May 1, 2013 at 12:53 PM, Allan Fagner allan...@gmail.comjavascript:
  wrote:

 Hi guys,

 I'm new to Windsor and I'm trying to run it under medium trust. I've 
 researched old discussion about that but did not have any luck doing what 
 the old conversations suggest. I'm getting the following error while trying 
 to create an new instance of WindsorContainer:

 *Inheritance security rules violated while overriding member: 
 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security 
 accessibility of the overriding method must match the security 
 accessibility of the method being overriden.*
 *
 *
 I noticed there are build options but did not understand what parameter I 
 should be passing in in order to build a version that works on medium trust.

 Can anyone help me with that?

 Thanks

 Allan

 -- 
 You received this message because you are subscribed to the Google Groups 
 Castle Project Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to castle-project-users+unsubscr...@googlegroups.com javascript:.
 To post to this group, send email to 
 castle-pro...@googlegroups.comjavascript:
 .
 Visit this group at 
 http://groups.google.com/group/castle-project-users?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




 -- 
 Cheers,
 hammett
 http://www.d-collab.com/
 http://hammett.castleproject.org/ 


-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Castle Windsor under medium trust

2013-05-02 Thread hammett
is this the only error?

I think it's safe to remove these overrides to InitializeLifetimeService
since I think they just kill the default remoting lease (rarely need, just
when using windsor through remoting)


On Wed, May 1, 2013 at 12:53 PM, Allan Fagner allanfag...@gmail.com wrote:

 Hi guys,

 I'm new to Windsor and I'm trying to run it under medium trust. I've
 researched old discussion about that but did not have any luck doing what
 the old conversations suggest. I'm getting the following error while trying
 to create an new instance of WindsorContainer:

 *Inheritance security rules violated while overriding member:
 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security
 accessibility of the overriding method must match the security
 accessibility of the method being overriden.*
 *
 *
 I noticed there are build options but did not understand what parameter I
 should be passing in in order to build a version that works on medium trust.

 Can anyone help me with that?

 Thanks

 Allan

 --
 You received this message because you are subscribed to the Google Groups
 Castle Project Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to castle-project-users+unsubscr...@googlegroups.com.
 To post to this group, send email to castle-project-users@googlegroups.com
 .
 Visit this group at
 http://groups.google.com/group/castle-project-users?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Cheers,
hammett
http://www.d-collab.com/
http://hammett.castleproject.org/

-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: castle windsor under medium trust

2010-11-11 Thread dazed3confused
It seems this error is occurring here

var container = new WindsorContainer(./Config/Castle.config);


On Nov 10, 11:48 pm, dazed3confused robhunter...@gmail.com wrote:
 Oops should have mentioned 'error creating windsor container' is aded
 by me, so exception is

 [Exception: Request for the permission
 of type 'System.Security.Permissions.SecurityPermission, mscorlib,
 Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
 failed.]
    Blog.Core.InversionOfControl.IoC.CreateWindsorContainer() in C:
 \Users\rob\Documents\Visual Studio 2008\Projects\Blog\Blog.Core
 \InversionOfControl\IoC.cs:106
    Blog.Core.InversionOfControl.IoC..cctor() in C:\Users\rob\Documents
 \Visual Studio 2008\Projects\Blog\Blog.Core\InversionOfControl\IoC.cs:
 35

 On Nov 10, 6:54 pm, dazed3confused robhunter...@gmail.com wrote:

  Hi

  Though this now works locally under medium trust, when I upload it to
  my web host I get this error

  [Exception: error creating windsor containerRequest for the permission
  of type 'System.Security.Permissions.SecurityPermission, mscorlib,
  Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
  failed.]
     Blog.Core.InversionOfControl.IoC.CreateWindsorContainer() in C:
  \Users\rob\Documents\Visual Studio 2008\Projects\Blog\Blog.Core
  \InversionOfControl\IoC.cs:106
     Blog.Core.InversionOfControl.IoC..cctor() in C:\Users\rob\Documents
  \Visual Studio 2008\Projects\Blog\Blog.Core\InversionOfControl\IoC.cs:
  35

  Do you think there is anything else I can do to make this work?

  I have asked my web host a couple times for for more details on their
  trust level but they are not very forth coming, Im thinking of
  changing my web host. I would imagine people use castle for their
  projects hosted on shared environments quite a lot?

  Thanks
  R

  On Nov 9, 10:02 am, Roelof Blom roelof.b...@gmail.com wrote:

   Cool!

   On Tue, Nov 9, 2010 at 10:45 AM, dazed3confused 
   robhunter...@gmail.comwrote:

Thanks for that guys, that was just what I needed. Got it working last
night from your instructions

On Nov 8, 11:16 am, Roelof Blom roelof.b...@gmail.com wrote:
 By the way, you'll need to create an APTCA build of Core also if using
 Windsor under medium trust.

 On Mon, Nov 8, 2010 at 12:15 PM, Roelof Blom roelof.b...@gmail.com
wrote:
  For now this should work: MSBuild buildscripts\build.proj
  /p:AllowPartiallyTrustedCallers=true /p:Configuration=Release
  /p:FrameworkVersion=v3.5 /p:BuildConfigKey=NET35

  The Windsor build will be changed (hopefully this week) to match 
  that
of
  Castle.Core and then it will be like this:
  MSBuild buildscripts\build.proj /p:AllowPartiallyTrustedCallers=true
  /p:Configuration=NET35-Release

  On Sat, Nov 6, 2010 at 5:47 PM, Mauricio Scheffer 
  mauricioschef...@gmail.com wrote:

  You can compile to 3.5 by saying build NET35.
  As for the parameter to enable the APTCA flag, the one you 
  mentioned
  before applies to NAnt, but the current build system is MSBuild so 
  it
won't
  work. Don't know how to set APTCA with the current build system
though...

  --
  Mauricio

  On Sat, Nov 6, 2010 at 1:32 PM, dazed3confused 
robhunter...@gmail.comwrote:

  Well, I'm pretty sure it is trust level that is the issue. I have
  tried rebuilding the source with the details, unfortunately its 
  not
  working as it requires .net 4. Does anyone know if its possible to
get
  a hold of the an older version that uses .net 3.5?

  This is the part of my code that seems to be causing the problem
  _container = new WindsorContainer(filePath);
  So is it perhaps an issue with Castle.Windsor rather than
Castle.Core?

  Thanks
  R

  On Nov 5, 2:56 pm, dazed3confused robhunter...@gmail.com wrote:
   Oops just realised I ment to add to that last post  in my web
config-

   !-- Application Settings --
     appSettings
       !-- The path to the castle config file to configure 
   dependency
   injection --
       add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
   \Castle.config/
     /appSettings

   and I have a seperate xml file called Castle.config which 
   contains-
   ?xml version=1.0 encoding=utf-8 ?
   configuration
           components
                   component
                                   id=blog.daofactory

  service=Blog.Core.DataAccess.IDaoFactory, Blog.Core
                                   type=Blog.Dal.DAOs.DaoFactory,
  Blog.Dal
                   /component
                   component
                                   id=blog.servicefactory

  service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core

type=Blog.Bll.Services.ServiceFactory,
  Blog.Bll
                   /component
           /components
   

Re: castle windsor under medium trust

2010-11-10 Thread dazed3confused
Oops should have mentioned 'error creating windsor container' is aded
by me, so exception is

[Exception: Request for the permission
of type 'System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.]
   Blog.Core.InversionOfControl.IoC.CreateWindsorContainer() in C:
\Users\rob\Documents\Visual Studio 2008\Projects\Blog\Blog.Core
\InversionOfControl\IoC.cs:106
   Blog.Core.InversionOfControl.IoC..cctor() in C:\Users\rob\Documents
\Visual Studio 2008\Projects\Blog\Blog.Core\InversionOfControl\IoC.cs:
35

On Nov 10, 6:54 pm, dazed3confused robhunter...@gmail.com wrote:
 Hi

 Though this now works locally under medium trust, when I upload it to
 my web host I get this error

 [Exception: error creating windsor containerRequest for the permission
 of type 'System.Security.Permissions.SecurityPermission, mscorlib,
 Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
 failed.]
    Blog.Core.InversionOfControl.IoC.CreateWindsorContainer() in C:
 \Users\rob\Documents\Visual Studio 2008\Projects\Blog\Blog.Core
 \InversionOfControl\IoC.cs:106
    Blog.Core.InversionOfControl.IoC..cctor() in C:\Users\rob\Documents
 \Visual Studio 2008\Projects\Blog\Blog.Core\InversionOfControl\IoC.cs:
 35

 Do you think there is anything else I can do to make this work?

 I have asked my web host a couple times for for more details on their
 trust level but they are not very forth coming, Im thinking of
 changing my web host. I would imagine people use castle for their
 projects hosted on shared environments quite a lot?

 Thanks
 R

 On Nov 9, 10:02 am, Roelof Blom roelof.b...@gmail.com wrote:

  Cool!

  On Tue, Nov 9, 2010 at 10:45 AM, dazed3confused 
  robhunter...@gmail.comwrote:

   Thanks for that guys, that was just what I needed. Got it working last
   night from your instructions

   On Nov 8, 11:16 am, Roelof Blom roelof.b...@gmail.com wrote:
By the way, you'll need to create an APTCA build of Core also if using
Windsor under medium trust.

On Mon, Nov 8, 2010 at 12:15 PM, Roelof Blom roelof.b...@gmail.com
   wrote:
 For now this should work: MSBuild buildscripts\build.proj
 /p:AllowPartiallyTrustedCallers=true /p:Configuration=Release
 /p:FrameworkVersion=v3.5 /p:BuildConfigKey=NET35

 The Windsor build will be changed (hopefully this week) to match that
   of
 Castle.Core and then it will be like this:
 MSBuild buildscripts\build.proj /p:AllowPartiallyTrustedCallers=true
 /p:Configuration=NET35-Release

 On Sat, Nov 6, 2010 at 5:47 PM, Mauricio Scheffer 
 mauricioschef...@gmail.com wrote:

 You can compile to 3.5 by saying build NET35.
 As for the parameter to enable the APTCA flag, the one you mentioned
 before applies to NAnt, but the current build system is MSBuild so it
   won't
 work. Don't know how to set APTCA with the current build system
   though...

 --
 Mauricio

 On Sat, Nov 6, 2010 at 1:32 PM, dazed3confused 
   robhunter...@gmail.comwrote:

 Well, I'm pretty sure it is trust level that is the issue. I have
 tried rebuilding the source with the details, unfortunately its not
 working as it requires .net 4. Does anyone know if its possible to
   get
 a hold of the an older version that uses .net 3.5?

 This is the part of my code that seems to be causing the problem
 _container = new WindsorContainer(filePath);
 So is it perhaps an issue with Castle.Windsor rather than
   Castle.Core?

 Thanks
 R

 On Nov 5, 2:56 pm, dazed3confused robhunter...@gmail.com wrote:
  Oops just realised I ment to add to that last post  in my web
   config-

  !-- Application Settings --
    appSettings
      !-- The path to the castle config file to configure 
  dependency
  injection --
      add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
  \Castle.config/
    /appSettings

  and I have a seperate xml file called Castle.config which 
  contains-
  ?xml version=1.0 encoding=utf-8 ?
  configuration
          components
                  component
                                  id=blog.daofactory

 service=Blog.Core.DataAccess.IDaoFactory, Blog.Core
                                  type=Blog.Dal.DAOs.DaoFactory,
 Blog.Dal
                  /component
                  component
                                  id=blog.servicefactory

 service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core

   type=Blog.Bll.Services.ServiceFactory,
 Blog.Bll
                  /component
          /components
  /configuration

 --
 You received this message because you are subscribed to the Google
   Groups
 Castle Project Users group.
 To post to this group, send email to
 castle-project-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 

Re: castle windsor under medium trust

2010-11-08 Thread Roelof Blom
For now this should work: MSBuild buildscripts\build.proj
/p:AllowPartiallyTrustedCallers=true /p:Configuration=Release
/p:FrameworkVersion=v3.5 /p:BuildConfigKey=NET35

The Windsor build will be changed (hopefully this week) to match that of
Castle.Core and then it will be like this:
MSBuild buildscripts\build.proj /p:AllowPartiallyTrustedCallers=true
/p:Configuration=NET35-Release

On Sat, Nov 6, 2010 at 5:47 PM, Mauricio Scheffer 
mauricioschef...@gmail.com wrote:

 You can compile to 3.5 by saying build NET35.
 As for the parameter to enable the APTCA flag, the one you mentioned before
 applies to NAnt, but the current build system is MSBuild so it won't work.
 Don't know how to set APTCA with the current build system though...

 --
 Mauricio



 On Sat, Nov 6, 2010 at 1:32 PM, dazed3confused robhunter...@gmail.comwrote:

 Well, I'm pretty sure it is trust level that is the issue. I have
 tried rebuilding the source with the details, unfortunately its not
 working as it requires .net 4. Does anyone know if its possible to get
 a hold of the an older version that uses .net 3.5?

 This is the part of my code that seems to be causing the problem
 _container = new WindsorContainer(filePath);
 So is it perhaps an issue with Castle.Windsor rather than Castle.Core?

 Thanks
 R

 On Nov 5, 2:56 pm, dazed3confused robhunter...@gmail.com wrote:
  Oops just realised I ment to add to that last post  in my web config-
 
  !-- Application Settings --
appSettings
  !-- The path to the castle config file to configure dependency
  injection --
  add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
  \Castle.config/
/appSettings
 
  and I have a seperate xml file called Castle.config which contains-
  ?xml version=1.0 encoding=utf-8 ?
  configuration
  components
  component
  id=blog.daofactory
 
 service=Blog.Core.DataAccess.IDaoFactory, Blog.Core
  type=Blog.Dal.DAOs.DaoFactory,
 Blog.Dal
  /component
  component
  id=blog.servicefactory
 
 service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core
  type=Blog.Bll.Services.ServiceFactory,
 Blog.Bll
  /component
  /components
  /configuration

 --
 You received this message because you are subscribed to the Google Groups
 Castle Project Users group.
 To post to this group, send email to
 castle-project-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 castle-project-users+unsubscr...@googlegroups.comcastle-project-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/castle-project-users?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Castle Project Users group.
 To post to this group, send email to castle-project-users@googlegroups.com
 .
 To unsubscribe from this group, send email to
 castle-project-users+unsubscr...@googlegroups.comcastle-project-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/castle-project-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



Re: castle windsor under medium trust

2010-11-06 Thread dazed3confused
Well, I'm pretty sure it is trust level that is the issue. I have
tried rebuilding the source with the details, unfortunately its not
working as it requires .net 4. Does anyone know if its possible to get
a hold of the an older version that uses .net 3.5?

This is the part of my code that seems to be causing the problem
_container = new WindsorContainer(filePath);
So is it perhaps an issue with Castle.Windsor rather than Castle.Core?

Thanks
R

On Nov 5, 2:56 pm, dazed3confused robhunter...@gmail.com wrote:
 Oops just realised I ment to add to that last post  in my web config-

 !-- Application Settings --
   appSettings
     !-- The path to the castle config file to configure dependency
 injection --
     add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
 \Castle.config/
   /appSettings

 and I have a seperate xml file called Castle.config which contains-
 ?xml version=1.0 encoding=utf-8 ?
 configuration
         components
                 component
                                 id=blog.daofactory
                                 service=Blog.Core.DataAccess.IDaoFactory, 
 Blog.Core
                                 type=Blog.Dal.DAOs.DaoFactory, Blog.Dal
                 /component
                 component
                                 id=blog.servicefactory
                                 
 service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core
                                 type=Blog.Bll.Services.ServiceFactory, 
 Blog.Bll
                 /component
         /components
 /configuration

-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



Re: castle windsor under medium trust

2010-11-06 Thread Mauricio Scheffer
You can compile to 3.5 by saying build NET35.
As for the parameter to enable the APTCA flag, the one you mentioned before
applies to NAnt, but the current build system is MSBuild so it won't work.
Don't know how to set APTCA with the current build system though...

--
Mauricio



On Sat, Nov 6, 2010 at 1:32 PM, dazed3confused robhunter...@gmail.comwrote:

 Well, I'm pretty sure it is trust level that is the issue. I have
 tried rebuilding the source with the details, unfortunately its not
 working as it requires .net 4. Does anyone know if its possible to get
 a hold of the an older version that uses .net 3.5?

 This is the part of my code that seems to be causing the problem
 _container = new WindsorContainer(filePath);
 So is it perhaps an issue with Castle.Windsor rather than Castle.Core?

 Thanks
 R

 On Nov 5, 2:56 pm, dazed3confused robhunter...@gmail.com wrote:
  Oops just realised I ment to add to that last post  in my web config-
 
  !-- Application Settings --
appSettings
  !-- The path to the castle config file to configure dependency
  injection --
  add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
  \Castle.config/
/appSettings
 
  and I have a seperate xml file called Castle.config which contains-
  ?xml version=1.0 encoding=utf-8 ?
  configuration
  components
  component
  id=blog.daofactory
 
 service=Blog.Core.DataAccess.IDaoFactory, Blog.Core
  type=Blog.Dal.DAOs.DaoFactory,
 Blog.Dal
  /component
  component
  id=blog.servicefactory
 
 service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core
  type=Blog.Bll.Services.ServiceFactory,
 Blog.Bll
  /component
  /components
  /configuration

 --
 You received this message because you are subscribed to the Google Groups
 Castle Project Users group.
 To post to this group, send email to castle-project-users@googlegroups.com
 .
 To unsubscribe from this group, send email to
 castle-project-users+unsubscr...@googlegroups.comcastle-project-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/castle-project-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



Re: castle windsor under medium trust

2010-11-05 Thread dazed3confused
Hi

I just wanted to ask as I had taken quite a bit of time last night to
get this working, and didn't really manage, so wanted to check I was
going along the right direction with this, as Ive since read a few
posts saying running under medium trust isnt an issue and it should
work fine.

The error I am getting is-
Exception Details: System.Security.SecurityException: That assembly
does not allow partially trusted callers.

[SecurityException: That assembly does not allow partially trusted
callers.]
   Blog.Core.InversionOfControl.IoC..cctor() in C:\Users\rob\Documents
\Visual Studio 2008\Projects\Blog\Blog.Core\InversionOfControl\IoC.cs:
58


And the code for that class is-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
using System.IO;
using System.Configuration;
using Blog.Core.DataAccess;
using Blog.Common.DesignByContract;
using Blog.Core.ServiceInterfaces;

namespace Blog.Core.InversionOfControl
{
public static class IoC
{
#region Members

/// summary
/// Windsor container instance
/// /summary
private static IWindsorContainer _container = null;

#endregion

#region Construction

/// summary
/// Statically initialises the see cref=IoC/ class.
/// Reads castle config file to initialise the container
/// /summary
static IoC()
{
string filePath =
ConfigurationManager.AppSettings[CASTLE_CONFIG_FILE];
if (filePath != null  filePath != )
{
Require.Is.NotBlank(filePath, Castle config file not
specified in app/web config.\r\nPlease add appSettings element with
CASTLE_CONFIG_FILE key);
//will resolve filePath if running in web context
filePath = filePath.Replace(currentDirectory//,
AppDomain.CurrentDomain.BaseDirectory);
//will resolve the filePath if running in test context
filePath = filePath.Replace(currentDirectory\\,
AppDomain.CurrentDomain.BaseDirectory.Replace(bin\\Debug, ));

//filePath = AppDomain.CurrentDomain.BaseDirectory;
if (File.Exists(filePath))
{
Require.Is.True(File.Exists(filePath),
Specified file does not exist:  + filePath);

_container = new WindsorContainer(filePath);

}
else
{
throw new Exception(filePath does not exist);
}
}
}

#endregion

#region Public Static Methods

/// summary
/// Resolves an instance via the windsor container.
/// /summary
/// typeparam name=TThe type of the instance/typeparam
/// returnsNew or existing instance/returns
public static T ResolveT()
{
object instance = _container.Resolve(typeof(T));
return instance != null ? (T)instance : default(T);
}

/// summary
/// Gets a DAO from the windsor container.
/// /summary
/// typeparam name=TThe type of the DAO to return/
typeparam
/// returnsA DAO object of the given DAO type/returns
public static T GetDaoT()
{
IDaoFactory daoFactory = ResolveIDaoFactory();
Require.Is.NotNull(daoFactory,
DaoFactory instance can not be retreived from dat IoC
container!);

return daoFactory.GetDaoT();
}


#endregion
}
}


I'm not sure why the error has the full file path from my dev machine,
as this is the error on my web space, it works fine locally

Thanks for any help
Regards
Rob

-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



Re: castle windsor under medium trust

2010-11-05 Thread dazed3confused
Oops just realised I ment to add to that last post  in my web config-

!-- Application Settings --
  appSettings
!-- The path to the castle config file to configure dependency
injection --
add key=CASTLE_CONFIG_FILE value=currentDirectory\Config
\Castle.config/
  /appSettings

and I have a seperate xml file called Castle.config which contains-
?xml version=1.0 encoding=utf-8 ?
configuration
components
component
id=blog.daofactory
service=Blog.Core.DataAccess.IDaoFactory, 
Blog.Core
type=Blog.Dal.DAOs.DaoFactory, Blog.Dal
/component
component
id=blog.servicefactory

service=Blog.Core.ServiceInterfaces.IServiceFactory, Blog.Core
type=Blog.Bll.Services.ServiceFactory, 
Blog.Bll
/component
/components
/configuration

-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.



Re: castle windsor under medium trust

2010-11-04 Thread Patrick Steele
It's been moved to git:

http://stw.castleproject.org/How-to-submit-a-fix-to-any-Castle-Project.ashx

This page talks about submitting a fix, but the beginning goes into
detail about getting a copy of the source down to your local machine
for compiling.

---
Patrick Steele
http://weblogs.asp.net/psteele



On Thu, Nov 4, 2010 at 3:55 PM, dazed3confused robhunter...@gmail.com wrote:
 Hi

 I am trying to get castle to run under medium trust so it works in my
 host environment. I found a post in the fourm-


 By default the build does not generate assemblies with the
 AllowPartiallyTrustedCallersAttribute, but you can easily create them:

   1. Check out latest trunk from
   http://svn.castleproject.org:8080/svn/castle/trunk/
   2. Run 'build.cmd -D:assembly.allow-partially-trusted-callers=true
   release quick build' from the root dir.


 But when I try getting the version from the trunk I get an error
 saying could not connect to server. Is this still the location of the
 trunk?

 Thanks for any help
 Rob

 --
 You received this message because you are subscribed to the Google Groups 
 Castle Project Users group.
 To post to this group, send email to castle-project-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 castle-project-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/castle-project-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Castle Project Users group.
To post to this group, send email to castle-project-us...@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.