--
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-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
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.
>
> 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!
>
> <!--medium-trusttesting -->
> On Dec 4, 12:45 pm, Krzysztof Ko¼mic <krzysztof.koz...@gmail.com>
> wrote:
>
> > no,
>
> > Current NH uses DP 2.1 but will update soon.
>
> > 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
>
> ...
>
> read more »
On Jan 1, 4:12 pm, fire <dan...@gmail.com> wrote:
> I get the issue off the trunk binaries.
> Narrowed down to ModuleScope.
> Did a quick test to make sure it was and here is a photo (in the
> files section):http://groups.google.com/group/castle-project-users/web/dynamicproxy2...
> > PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293"/
>
> > </CodeGroup>
> > <CodeGroup class="UnionCodeGroup" version="1"
>
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -
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.
> ...
>
> więcej >>
=======================
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 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/Web/CastleDynamicProxy/default.build
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: build
common.find-svninfo:
[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
common.build:
common.build.internal:
[nant] C:\Web\CastleDynamicProxy\src\Castle.DynamicProxy
\default.build
Buildfile: file:///C:/Web/CastleDynamicProxy/src/Castle.DynamicProxy/default.build
Target framework: Microsoft .NET Framework 3.5
Target(s) specified: build
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\_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\_revision.xml' does not exist.
[echo] INFO: Using Subversion revision number: 0
set-framework-configuration:
[script] Scanning assembly "op4sf4wa" for extensions.
set-net-3.5-framework-configuration:
set-project-configuration:
set-debug-project-configuration:
common.init:
init:
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:
build:
BUILD SUCCEEDED - 2 non-fatal error(s), 0 warning(s)
Total time: 1 seconds.
[nant] C:\Web\CastleDynamicProxy\src\Castle.DynamicProxy.Tests
\default.build
Buildfile: file:///C:/Web/CastleDynamicProxy/src/Castle.DynamicProxy.Tests/default.build
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.
sorry for the inconvenience, we are changing our build, moving away
from nant.
try to build with the following command (assuming you have NAnt in
your PATH)
nant -D:assembly.allow-partially-trusted-callers=true clean merge
build
about the reasons for not providing APTCA assemblies OOTB see this
thread:
http://groups.google.com/group/castle-project-devel/browse_thread/thread/33a891ce7da71225/f6bd971e33a54a9c
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?
>
> =======================
>
> NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
> Copyright (C) 2001-2007 Gerry Shawhttp://nant.sourceforge.net
> ...
>
> więcej >>
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
> 2010/1/22 Krzysztof Koźmic (2) <krzysz...@kozmic.pl>
>
> > Sam,
>
> > sorry for the inconvenience, we are changing our build, moving away
> > from nant.
>
> > try to build with the following command (assuming you have NAnt in
> > your PATH)
>
> > nant -D:assembly.allow-partially-trusted-callers=true clean merge
> > build
>
> > about the reasons for not providing APTCA assemblies OOTB see this
> > thread:
>
> >http://groups.google.com/group/castle-project-devel/browse_thread/thr...
> ...
>
> więcej »
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:
> http://groups.google.com/group/castle-project-users/web/APTCA-DP-UNSU...
> > > file:///C:/Web/CastleDynamicProxy/src/Castle.DynamicProxy.Tests/default.build
could you post that to the wiki:
http://using.castleproject.org/display/CASTLE/Castle+Project
it would be more easily discoverable... google thread will disappear
quickly and we'll have people asking the same question over again.
cheers,
Krzysztof
> steps 3& 4