问题描述
我想在中等信任运行Castle.Core,我知道如何做到这一点在理论上。
I want to run Castle.Core under medium trust, and I know how to do it in theory.
- 添加[AllowPatiallyTrustedCallers]到Assembly.cs
- 禁用跟踪记录器 - (因为它使用反射)
第一个问题,有没有Assembly.cs,这样显然可以使用楠建设用以下命令行:
First problem, there is is no Assembly.cs, so apparently you can use nant to build with a command line like:
恶性-D:assembly.allow-部分信任,呼叫者=真
但是,返回错误
NAnt 0.84 (Build 0.84.1455.0; net-1.0.win32; release; 26/12/2003)
Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///D:/Downloads/development - source/Castle Proxy/Core/src/Castl
e.Core/default.build
Target(s) specified: nant
BUILD FAILED
Property 'project::get-name()' has not been set.
Total time: 0.1 seconds.
如何设置这样或解决问题?在SVN这样做的Castle.Core是 https://svn.castleproject.org/svn/城堡/核心/后备箱让你的欢迎,检查出来才回答,如果你想
How do I set this or resolve the issue?The svn for this the Castle.Core is https://svn.castleproject.org/svn/castle/Core/trunk so your welcome to check it out before answering if you want
推荐答案
[更新]
好了,是我不好。我不是在中等信任问题专家,但据我所知它,你毕竟需要APTCA上城集会。
OK, my bad. I'm not an expert in medium trust issues, but the way I understand it, you need APTCA on Castle assemblies after all.
因此,这里是我所做的:
So here's what I did:
我把城堡的核心来源: https://svn.castleproject.org/svn/城堡/核心/后备箱下载最新的每日构建楠,并建立其与恶性构建-D:assembly.allow-部分信任,呼叫者=真
I pulled Castle Core from: https://svn.castleproject.org/svn/castle/Core/trunkdownloaded latest nightly build of NAnt and built it with nant build -D:assembly.allow-partially-trusted-callers=true
然后我下载了动态代理自: https://svn.castleproject.org/svn /城堡/ DynamicProxy /后备箱
I then downloaded Dynamic Proxy from: https://svn.castleproject.org/svn/castle/DynamicProxy/trunk
复制的核心组件,我建于previous步为lib / NET-35,然后建立DP与同南特的命令。
copied the Core assembly I built in previous step to lib/net-35 and then built DP with the same Nant command.
然后,我创建了信任级别的ASP.NET网站设置为中,并生成一对夫妇代理的它,和它的工作。
I then created an ASP.NET website with trust level set to Medium and generated a couple of proxies in it, and it worked.
如果由于某种原因,这并不为你工作,或者你有其他任何问题/建议,让我知道。
If for some reason that does not work for you, or you have any other issues/suggestions let me know.
这篇关于下载Castle.Core并添加[AllowPatiallyTrustedCallers]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!