On Sat, Dec 5, 2009 at 2:58 AM, Gitted <sahmed1...@gmail.com> wrote:
> I tried using the lastest version of castle.dynamic proxy but it seems
> there are API changes and I just don't want to go there myself :)
> Is this planned soon?
> if not, or in the meantime, I can't find the castle.dynamic build used
> in the current nhibernate release ?
> the subversion repo also seems to have /trunk.
> --
> 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+unsubscribe@googlegroups.com<castle-project-users%2Bun subscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
Jonathon Rossi wrote:
> IIRC NHibernate's current release is using DynamicProxy 2.1 RTM which > should be in the NHibernate zip file downloadable from sourceforge.
> On Sat, Dec 5, 2009 at 2:58 AM, Gitted <sahmed1...@gmail.com > <mailto:sahmed1...@gmail.com>> wrote:
> I tried using the lastest version of castle.dynamic proxy but it seems
> there are API changes and I just don't want to go there myself :)
> Is this planned soon?
> if not, or in the meantime, I can't find the castle.dynamic build used
> in the current nhibernate release ?
> the subversion repo also seems to have /trunk.
> --
> 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
> <mailto:castle-project-users@googlegroups.com>.
> To unsubscribe from this group, send email to
> castle-project-users+unsubscribe@googlegroups.com
> <mailto:castle-project-users%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
> -- > Jono
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en.
> Jonathon Rossi wrote:
> > IIRC NHibernate's current release is using DynamicProxy 2.1 RTM which
> > should be in the NHibernate zip file downloadable from sourceforge.
> > On Sat, Dec 5, 2009 at 2:58 AM, Gitted <sahmed1...@gmail.com
> > <mailto:sahmed1...@gmail.com>> wrote:
> > I tried using the lastest version of castle.dynamic proxy but it seems
> > there are API changes and I just don't want to go there myself :)
> > Is this planned soon?
> > if not, or in the meantime, I can't find the castle.dynamic build used
> > in the current nhibernate release ?
> > the subversion repo also seems to have /trunk.
> > --
> > 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
> > <mailto:castle-project-users@googlegroups.com>.
> > To unsubscribe from this group, send email to
> > castle-project-users+unsubscribe@googlegroups.com
> > <mailto:castle-project-users%2Bunsubscribe@googlegroups.com>.
> > For more options, visit this group at
> > http://groups.google.com/group/castle-project-users?hl=en.
> > --
> > Jono
> > --
> > 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+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/castle-project-users?hl=en.
Gitted wrote:
> So are you both saying the opposite things here? :)
> On Dec 4, 12:17 pm, Krzysztof Koźmic <krzysztof.koz...@gmail.com>
> wrote:
>> yeah,
>> provider for Castle will be updated soon.
>> Jonathon Rossi wrote:
>>> IIRC NHibernate's current release is using DynamicProxy 2.1 RTM which
>>> should be in the NHibernate zip file downloadable from sourceforge.
>>> On Sat, Dec 5, 2009 at 2:58 AM, Gitted <sahmed1...@gmail.com
>>> <mailto:sahmed1...@gmail.com>> wrote:
>>> I tried using the lastest version of castle.dynamic proxy but it seems
>>> there are API changes and I just don't want to go there myself :)
>>> Is this planned soon?
>>> if not, or in the meantime, I can't find the castle.dynamic build used
>>> in the current nhibernate release ?
>>> the subversion repo also seems to have /trunk.
>>> --
>>> 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
>>> <mailto:castle-project-users@googlegroups.com>.
>>> To unsubscribe from this group, send email to
>>> castle-project-users+unsubscribe@googlegroups.com
>>> <mailto:castle-project-users%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at
>>> http://groups.google.com/group/castle-project-users?hl=en.
>>> --
>>> Jono
>>> --
>>> 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+unsubscribe@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+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
Thanks, currently I am stuck because of medium trust issues at
rackspacecloud sites.
Exception Details: System.Security.SecurityException: That assembly
does not allow partially trusted callers.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: That assembly does not allow partially trusted
callers.]
Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly,
String strongAssemblyName, String strongModulePath, String
weakAssemblyName, String weakModulePath) +0
Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly)
+35
Castle.DynamicProxy.ProxyGenerator..ctor() +38
NHibernate.ByteCode.Castle.ProxyFactory..cctor() +49
This is the web.config they gave for testing, although it works
locally so not sure if this "test" web.config is of any use!
> Thanks, currently I am stuck because ofmediumtrustissues at > rackspacecloud sites.
> Exception Details: System.Security.SecurityException: That assembly > does not allow partially trusted callers.
> Source Error:
> An unhandled exception was generated during the execution of the > current web request. Information regarding the origin and location of > the exception can be identified using the exception stack trace below.
> On Dec 4 2009, 6:49 pm, Gitted <sahmed1...@gmail.com> wrote:
> > Thanks, currently I am stuck because ofmediumtrustissues at > > rackspacecloud sites.
> > Exception Details: System.Security.SecurityException: That assembly > > does not allow partially trusted callers.
> > Source Error:
> > An unhandled exception was generated during the execution of the > > current web request. Information regarding the origin and location of > > the exception can be identified using the exception stack trace below.
Yes, they were, but you need the assembly to have the AllowPartiallyCallersAttribute, which means you will have to build it yourself, since we do not provide such version for security reasons.
On 22 Sty, 08:45, Sam Kimmel <sweep...@gmail.com> wrote:
> > On Dec 4 2009, 6:49 pm, Gitted <sahmed1...@gmail.com> wrote:
> > > Thanks, currently I am stuck because ofmediumtrustissues at > > > rackspacecloud sites.
> > > Exception Details: System.Security.SecurityException: That assembly > > > does not allow partially trusted callers.
> > > Source Error:
> > > An unhandled exception was generated during the execution of the > > > current web request. Information regarding the origin and location of > > > the exception can be identified using the exception stack trace below.
Thanks Krzysztof. I downloaded Nant and haven't had any luck building from the trunk. I went to the buildscripts folder and ran the build.cmd as per the instructions. When I ran it I got an error:
======================= This project is not configured to be built with MSBuild. Please use the NAnt script in the root folder of this project. =======================
So then I went back to the root and ran NAnt. Exactly where do I need to specify to allow partially trusted callers? Also is there a way to get it to do a release build instead of a debug? Below are the results of the NAnt process...
But before that, exactly what are the security reasons for not providing a AllowPartiallyCallers version? If web users have to go beyond Medium Trust to use Dynamic Proxy aren't they already making their app less secure?
[exec] C:\Web\CastleDynamicProxy\buildscripts\common.xml(195,4): [exec] 'svn' failed to start. [xmlpeek] Peeking at 'C:\Web\CastleDynamicProxy\_revision.xml' with XPath expression '/info/entry/@revision'. [xmlpeek] C:\Web\CastleDynamicProxy\buildscripts\common.xml(206,4): [xmlpeek] XML file 'C:\Web\CastleDynamicProxy\_revision.xml' does not exist. [echo] INFO: Using Subversion revision number: 0
[nant] C:\Web\CastleDynamicProxy\src\Castle.DynamicProxy.Tests \default.build Buildfile: file:///C:/Web/CastleDynamicProxy/src/Castle.DynamicProxy.Tests/default.bui ld Target framework: Microsoft .NET Framework 3.5 Target(s) specified: test
common.find-svninfo:
[exec] C:\Web\CastleDynamicProxy\buildscripts \common.xml(195,4): [exec] 'svn' failed to start. [xmlpeek] Peeking at 'C:\Web\CastleDynamicProxy\src \Castle.DynamicProxy.Tests\_revision.xml' with XPath expression '/info/ entry/@revision'. [xmlpeek] C:\Web\CastleDynamicProxy\buildscripts \common.xml(206,4): [xmlpeek] XML file 'C:\Web\CastleDynamicProxy\src \Castle.DynamicProxy.Tests\_revision.xml' does not exist. [echo] INFO: Using Subversion revision number: 0
set-framework-configuration:
[script] Scanning assembly "waldny83" for extensions.
set-net-3.5-framework-configuration:
set-project-configuration:
set-debug-project-configuration:
common.init:
common.copy.project.references:
[copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'.
init:
common.compile-tests:
common.set-assembly-attribute-values:
common.generate-assemblyinfo:
[attrib] Setting file attributes for 1 files to Normal.
common.copy.project.references:
[copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'. [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy \build\net-3.5\debug'.
common.compile-dll:
common.configure-tests:
[attrib] Setting file attributes for 1 files to Normal. [xmlpoke] No matching nodes were found with XPath expression '/configuration/appSettings/add[@key='tests.src']/@value'.
common.run-tests:
[echo] Running tests in 'Castle.DynamicProxy2.Tests'
BUILD FAILED - 2 non-fatal error(s), 1 warning(s)
C:\Web\CastleDynamicProxy\buildscripts\common-project.xml (311,5): 'nunit-console.exe' failed to start. The system cannot find the file specified
Total time: 1 seconds.
BUILD FAILED - 2 non-fatal error(s), 0 warning(s)
Nested build failed. Refer to build log for exact reason.
Total time: 2.2 seconds.
On Jan 22, 1:51 am, Krzysztof KoŒmic (2) <krzysz...@kozmic.pl> wrote:
> Yes, they were, but you need the assembly to have the > AllowPartiallyCallersAttribute, which means you will have to build it > yourself, since we do not provide such version for security reasons.
> On 22 Sty, 08:45, Sam Kimmel <sweep...@gmail.com> wrote:
> > Same issue here. I thought Medium Trust issues were fixed in 2.2?
> > On Jan 1, 4:12 pm, fire <dan...@gmail.com> wrote:
> > > On Dec 4 2009, 6:49 pm, Gitted <sahmed1...@gmail.com> wrote:
> > > > Thanks, currently I am stuck because ofmediumtrustissues at > > > > rackspacecloud sites.
> > > > Exception Details: System.Security.SecurityException: That assembly > > > > does not allow partially trusted callers.
> > > > Source Error:
> > > > An unhandled exception was generated during the execution of the > > > > current web request. Information regarding the origin and location of > > > > the exception can be identified using the exception stack trace below.
> Thanks Krzysztof. I downloaded Nant and haven't had any luck building > from the trunk. I went to the buildscripts folder and ran the > build.cmd as per the instructions. When I ran it I got an error:
> ======================= > This project is not configured to be built with MSBuild. > Please use the NAnt script in the root folder of this project. > =======================
> So then I went back to the root and ran NAnt. Exactly where do I need > to specify to allow partially trusted callers? Also is there a way to > get it to do a release build instead of a debug? Below are the > results of the NAnt process...
> But before that, exactly what are the security reasons for not > providing a AllowPartiallyCallers version? If web users have to go > beyond Medium Trust to use Dynamic Proxy aren't they already making > their app less secure?
> [nant] C:\Web\CastleDynamicProxy\src\Castle.DynamicProxy.Tests > \default.build > Buildfile: file:///C:/Web/CastleDynamicProxy/src/Castle.DynamicProxy.Tests/default.bui ld > Target framework: Microsoft .NET Framework 3.5 > Target(s) specified: test
> common.find-svninfo:
> [exec] C:\Web\CastleDynamicProxy\buildscripts > \common.xml(195,4): > [exec] 'svn' failed to start. > [xmlpeek] Peeking at 'C:\Web\CastleDynamicProxy\src > \Castle.DynamicProxy.Tests\_revision.xml' with XPath expression '/info/ > entry/@revision'. > [xmlpeek] C:\Web\CastleDynamicProxy\buildscripts > \common.xml(206,4): > [xmlpeek] XML file 'C:\Web\CastleDynamicProxy\src > \Castle.DynamicProxy.Tests\_revision.xml' does not exist. > [echo] INFO: Using Subversion revision number: 0
> set-framework-configuration:
> [script] Scanning assembly "waldny83" for extensions.
> set-net-3.5-framework-configuration:
> set-project-configuration:
> set-debug-project-configuration:
> common.init:
> common.copy.project.references:
> [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'.
> init:
> common.compile-tests:
> common.set-assembly-attribute-values:
> common.generate-assemblyinfo:
> [attrib] Setting file attributes for 1 files to Normal.
> common.copy.project.references:
> [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'. > [copy] Copying 1 file to 'C:\Web\CastleDynamicProxy > \build\net-3.5\debug'.
> common.compile-dll:
> common.configure-tests:
> [attrib] Setting file attributes for 1 files to Normal. > [xmlpoke] No matching nodes were found with XPath > expression '/configuration/appSettings/add[@key='tests.src']/@value'.
> common.run-tests:
> [echo] Running tests in 'Castle.DynamicProxy2.Tests'
> C:\Web\CastleDynamicProxy\buildscripts\common-project.xml > (311,5): > 'nunit-console.exe' failed to start. > The system cannot find the file specified
> Nested build failed. Refer to build log for exact reason.
> Total time: 2.2 seconds.
> On Jan 22, 1:51 am, Krzysztof Ko 1/4 mic (2) <krzysz...@kozmic.pl> wrote:
> > Sam,
> > Yes, they were, but you need the assembly to have the > > AllowPartiallyCallersAttribute, which means you will have to build it > > yourself, since we do not provide such version for security reasons.
> > On 22 Sty, 08:45, Sam Kimmel <sweep...@gmail.com> wrote:
> > > Same issue here. I thought Medium Trust issues were fixed in 2.2?
> > > On Jan 1, 4:12 pm, fire <dan...@gmail.com> wrote:
> > > > On Dec 4 2009, 6:49 pm, Gitted <sahmed1...@gmail.com> wrote:
> > > > > Thanks, currently I am stuck because ofmediumtrustissues at > > > > > rackspacecloud sites.
> > > > > Exception Details: System.Security.SecurityException: That assembly > > > > > does not allow partially trusted callers.
> > > > > Source Error:
> > > > > An unhandled exception was generated during the execution of the > > > > > current web request. Information regarding the origin and location of > > > > > the exception can be identified using the exception stack trace below.
Thanks again. What you said makes sense. Unfortunately, I don't think the command is working. Should the final assembly sill end up in *debug *directory? I put in the fresh assembly and rebuilt the NHibernate.ByteCode.Castle project and my project but still get the same permission error (below). Do I need a different version of NAnt? I've tried NAnt 0.85 and 0.86 beta.
In Matijn Boland's blog<http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-...>he talked about adding the APTCA attribute and needing to make a modification to the code so that debug info wasn't emitted for AssemblyBuilder.DefineDynamicModule. The svn trunk already had this modification made (ModuleScope class). So I don't think that is the problem.
Medium Trust seems like a fairly common restraint put on shared hosting customers. How difficult would it be for the Castle team to set up the build process to output DynamicProxy2.dll and a DynamicProxy2MT.dll (with a disclaimer saying that the 2MT version should only be used when Medium Trust is the only option)?
Is there anyone out there with a working Medium Trust version of Dynamic Proxy 2.2 that would be willing to share the final assembly?
> On 22 Sty, 09:33, Sam Kimmel <sweep...@gmail.com> wrote: > > Thanks Krzysztof. I downloaded Nant and haven't had any luck building > > from the trunk. I went to the buildscripts folder and ran the > > build.cmd as per the instructions. When I ran it I got an error:
> > ======================= > > This project is not configured to be built with MSBuild. > > Please use the NAnt script in the root folder of this project. > > =======================
> > So then I went back to the root and ran NAnt. Exactly where do I need > > to specify to allow partially trusted callers? Also is there a way to > > get it to do a release build instead of a debug? Below are the > > results of the NAnt process...
> > But before that, exactly what are the security reasons for not > > providing a AllowPartiallyCallers version? If web users have to go > > beyond Medium Trust to use Dynamic Proxy aren't they already making > > their app less secure?
> > [attrib] Setting file attributes for 1 files to Normal. > > [xmlpoke] No matching nodes were found with XPath > > expression '/configuration/appSettings/add[@key='tests.src']/@value'.
> > common.run-tests:
> > [echo] Running tests in 'Castle.DynamicProxy2.Tests'
> > Nested build failed. Refer to build log for exact reason.
> > Total time: 2.2 seconds.
> > On Jan 22, 1:51 am, Krzysztof Ko 1/4 mic (2) <krzysz...@kozmic.pl> > wrote:
> > > Sam,
> > > Yes, they were, but you need the assembly to have the > > > AllowPartiallyCallersAttribute, which means you will have to build it > > > yourself,
> Thanks again. What you said makes sense. Unfortunately, I don't think the > command is working. Should the final assembly sill end up in *debug > *directory? > I put in the fresh assembly and rebuilt the NHibernate.ByteCode.Castle > project and my project but still get the same permission error (below). Do > I need a different version of NAnt? I've tried NAnt 0.85 and 0.86 beta.
> In Matijn Boland's > blog<http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-...>he > talked about adding the APTCA attribute and needing to make a > modification to the code so that debug info wasn't emitted for > AssemblyBuilder.DefineDynamicModule. The svn trunk already had this > modification made (ModuleScope class). So I don't think that is the problem.
> Medium Trust seems like a fairly common restraint put on shared hosting > customers. How difficult would it be for the Castle team to set up the > build process to output DynamicProxy2.dll and a DynamicProxy2MT.dll (with a > disclaimer saying that the 2MT version should only be used when Medium Trust > is the only option)?
> Is there anyone out there with a working Medium Trust version of Dynamic > Proxy 2.2 that would be willing to share the final assembly?
> > On 22 Sty, 09:33, Sam Kimmel <sweep...@gmail.com> wrote: > > > Thanks Krzysztof. I downloaded Nant and haven't had any luck building > > > from the trunk. I went to the buildscripts folder and ran the > > > build.cmd as per the instructions. When I ran it I got an error:
> > > ======================= > > > This project is not configured to be built with MSBuild. > > > Please use the NAnt script in the root folder of this project. > > > =======================
> > > So then I went back to the root and ran NAnt. Exactly where do I need > > > to specify to allow partially trusted callers? Also is there a way to > > > get it to do a release build instead of a debug? Below are the > > > results of the NAnt process...
> > > But before that, exactly what are the security reasons for not > > > providing a AllowPartiallyCallers version? If web users have to go > > > beyond Medium Trust to use Dynamic Proxy aren't they already making > > > their app less secure?
> > > [attrib] Setting file attributes for 1 files to Normal. > > > [xmlpoke] No matching nodes were found with XPath > > > expression '/configuration/appSettings/add[@key='tests.src']/@value'.
Thanks xtoff. When I saw the assemblies you posted I realized that both the Core and the Dynamic Proxy were rebuilt. I was only rebuilding the Dynamic Proxies.
Just in case anyone else is interested in getting NHibernate + Castle Dynamic Proxy working in medium trust, this is what you need to do:
1. If you don't have a SVN client, you'll need to download one. I used SubCommander (http://subcommander.tigris.org/), and while there seem to be a couple quirky interface bugs, it did allow me to download the trunks to the directories of my choice. 2. Download Nant (I used 0.86 beta) from http://nant.sourceforge.net/. To install: a. Extract it to a directory b. Create a file called nant.bat with the following contents and save it in C:\Windows @echo off "C:\<Path_To_Nant>\bin\NAnt.exe" %*
3. Download Castle Core from the svn: https://svn.castleproject.org/svn/castle/Core/trunk a. Edit the file buildscripts\CommonAssemblyInfo.cs and add the following: using System.Security; [assembly: AllowPartiallyTrustedCallers] (**Note**: I added this because the nant parameter below didn't seem to do inject it) b. Open the command prompt and navigate to the root directory, then run: nant -D:assembly.allow-partially-trusted-callers=true clean merge build
4. Download Castle Dynamic Proxies from the svn: https://svn.castleproject.org/svn/castle/DynamicProxy/trunk a. Copy the Castle.Core.dll from the build directory in Step 3 into the lib directory of the Dynamic Proxy project b. Open the command propomt and navigate to the root directory, then run: nant -D:assembly.allow-partially-trusted-callers=true clean merge build
5. Download the NHibernate source from: http://sourceforge.net/projects/nhibernate/files/ a. Open src\NHibernate.Everything.sln in Visual Studio b. Expand the NHibernate.ByteCode.Castle project i. Delete the references to Castle.Core and Castle.DynamicProxy2 and replace them with the assemblies created in steps 3 & 4 ii. Build NHibernate.ByteCode.Castle
6. Open the projects you are working on that require medium trust a. Update the references to Castle.Core, Castle.DynamicProxy2, and NHibernate.ByteCode.Castle in your project b. Make sure you have the [assembly: AllowPartiallyTrustedCallers] attribute in the AssemblyInfo.cs file for each of your own projects c. When setting up your NHibernate configuration, do this: /* for whatever reason, the <reflection-optimizer use="false"/> is being ignored in hibernate.cfg.xml, so we need this */ NHibernate.Cfg.Environment.UseReflectionOptimizer = false; config = new Configuration().Configure();
7. Build your projects and run your web pages in Medium Trust!
On Jan 22, 2:02 pm, xtoff <krzysztof.koz...@gmail.com> wrote:
> On 22 Sty, 20:32, Sam Kimmel <sweep...@gmail.com> wrote:
> > Krzysztof,
> > Thanks again. What you said makes sense. Unfortunately, I don't think the > > command is working. Should the final assembly sill end up in *debug > > *directory? > > I put in the fresh assembly and rebuilt the NHibernate.ByteCode.Castle > > project and my project but still get the same permission error (below). Do > > I need a different version of NAnt? I've tried NAnt 0.85 and 0.86 beta.
> > In Matijn Boland's > > blog<http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-...>he > > talked about adding the APTCA attribute and needing to make a > > modification to the code so that debug info wasn't emitted for > > AssemblyBuilder.DefineDynamicModule. The svn trunk already had this > > modification made (ModuleScope class). So I don't think that is the problem.
> > Medium Trust seems like a fairly common restraint put on shared hosting > > customers. How difficult would it be for the Castle team to set up the > > build process to output DynamicProxy2.dll and a DynamicProxy2MT.dll (with a > > disclaimer saying that the 2MT version should only be used when Medium Trust > > is the only option)?
> > Is there anyone out there with a working Medium Trust version of Dynamic > > Proxy 2.2 that would be willing to share the final assembly?
> > > On 22 Sty, 09:33, Sam Kimmel <sweep...@gmail.com> wrote: > > > > Thanks Krzysztof. I downloaded Nant and haven't had any luck building > > > > from the trunk. I went to the buildscripts folder and ran the > > > > build.cmd as per the instructions. When I ran it I got an error:
> > > > ======================= > > > > This project is not configured to be built with MSBuild. > > > > Please use the NAnt script in the root folder of this project. > > > > =======================
> > > > So then I went back to the root and ran NAnt. Exactly where do I need > > > > to specify to allow partially trusted callers? Also is there a way to > > > > get it to do a release build instead of a debug? Below are the > > > > results of the NAnt process...
> > > > But before that, exactly what are the security reasons for not > > > > providing a AllowPartiallyCallers version? If web users have to go > > > > beyond Medium Trust to use Dynamic Proxy aren't they already making > > > > their app less secure?
> Thanks xtoff. When I saw the assemblies you posted I realized that > both the Core and the Dynamic Proxy were rebuilt. I was only > rebuilding the Dynamic Proxies.
> Just in case anyone else is interested in getting NHibernate + Castle > Dynamic Proxy working in medium trust, this is what you need to do:
> 1. If you don't have a SVN client, you'll need to download one. I > used SubCommander (http://subcommander.tigris.org/), and while there > seem to be a couple quirky interface bugs, it did allow me to download > the trunks to the directories of my choice. > 2. Download Nant (I used 0.86 beta) from http://nant.sourceforge.net/. > To install: > a. Extract it to a directory > b. Create a file called nant.bat with the following contents and > save it in C:\Windows > @echo off > "C:\<Path_To_Nant>\bin\NAnt.exe" %*
> 3. Download Castle Core from the svn: https://svn.castleproject.org/svn/castle/Core/trunk > a. Edit the file buildscripts\CommonAssemblyInfo.cs and add the > following: > using System.Security; > [assembly: AllowPartiallyTrustedCallers] > (**Note**: I added this because the nant parameter below > didn't seem to do inject it) > b. Open the command prompt and navigate to the root directory, > then run: > nant -D:assembly.allow-partially-trusted-callers=true clean > merge build
> 4. Download Castle Dynamic Proxies from the svn: > https://svn.castleproject.org/svn/castle/DynamicProxy/trunk > a. Copy the Castle.Core.dll from the build directory in Step 3 > into the lib directory of the Dynamic Proxy project > b. Open the command propomt and navigate to the root directory, > then run: > nant -D:assembly.allow-partially-trusted-callers=true clean > merge build
> 5. Download the NHibernate source from: http://sourceforge.net/projects/nhibernate/files/ > a. Open src\NHibernate.Everything.sln in Visual Studio > b. Expand the NHibernate.ByteCode.Castle project > i. Delete the references to Castle.Core and > Castle.DynamicProxy2 and replace them with the assemblies created in > steps 3& 4 > ii. Build NHibernate.ByteCode.Castle
> 6. Open the projects you are working on that require medium trust > a. Update the references to Castle.Core, Castle.DynamicProxy2, > and NHibernate.ByteCode.Castle in your project > b. Make sure you have the [assembly: > AllowPartiallyTrustedCallers] attribute in the AssemblyInfo.cs file > for each of your own projects > c. When setting up your NHibernate configuration, do this: > /* for whatever reason, the<reflection-optimizer > use="false"/> is being ignored in hibernate.cfg.xml, so we need this > */ > NHibernate.Cfg.Environment.UseReflectionOptimizer = false; > config = new Configuration().Configure();
> 7. Build your projects and run your web pages in Medium Trust!
> On Jan 22, 2:02 pm, xtoff<krzysztof.koz...@gmail.com> wrote:
>> On 22 Sty, 20:32, Sam Kimmel<sweep...@gmail.com> wrote:
>>> Krzysztof,
>>> Thanks again. What you said makes sense. Unfortunately, I don't think the >>> command is working. Should the final assembly sill end up in *debug >>> *directory? >>> I put in the fresh assembly and rebuilt the NHibernate.ByteCode.Castle >>> project and my project but still get the same permission error (below). Do >>> I need a different version of NAnt? I've tried NAnt 0.85 and 0.86 beta.
>>> In Matijn Boland's >>> blog<http://blogs.taiga.nl/martijn/2009/06/24/new-adventures-under-medium-...>he >>> talked about adding the APTCA attribute and needing to make a >>> modification to the code so that debug info wasn't emitted for >>> AssemblyBuilder.DefineDynamicModule. The svn trunk already had this >>> modification made (ModuleScope class). So I don't think that is the problem.
>>> Medium Trust seems like a fairly common restraint put on shared hosting >>> customers. How difficult would it be for the Castle team to set up the >>> build process to output DynamicProxy2.dll and a DynamicProxy2MT.dll (with a >>> disclaimer saying that the 2MT version should only be used when Medium Trust >>> is the only option)?
>>> Is there anyone out there with a working Medium Trust version of Dynamic >>> Proxy 2.2 that would be willing to share the final assembly?
>>>> On 22 Sty, 09:33, Sam Kimmel<sweep...@gmail.com> wrote:
>>>>> Thanks Krzysztof. I downloaded Nant and haven't had any luck building >>>>> from the trunk. I went to the buildscripts folder and ran the >>>>> build.cmd as per the instructions. When I ran it I got an error:
>>>>> ======================= >>>>> This project is not configured to be built with MSBuild. >>>>> Please use the NAnt script in the root folder of this project. >>>>> =======================
>>>>> So then I went back to the root and ran NAnt. Exactly where do I need >>>>> to specify to allow partially trusted callers? Also is there a way to >>>>> get it to do a release build instead of a debug? Below are the >>>>> results of the NAnt process...
>>>>> But before that, exactly what are the security reasons for not >>>>> providing a AllowPartiallyCallers version? If web users have to go >>>>> beyond Medium Trust to use Dynamic Proxy aren't they already making >>>>> their app less secure?