失败的动作是LinkDemand [英] The action that failed was LinkDemand

查看:66
本文介绍了失败的动作是LinkDemand的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个exe文件,当在本地pc(A)中执行时可以运行,但是 当我在网络PC(B)中执行时,它没有执行.文件夹在哪里 该程序被共享具有正确的权限.唯一的是 网络计算机(B)与(A)计算机不在同一个IP范围内, 但两者都在同一个域中.我可以从一台电脑访问另一台电脑

I have an exe file that when execute in the local pc (A) works, but when I execute in a network pc (B) it doesn't. The folder where is the program is shared with the right permissions. The only thing is that the network pc (B) isn't in the same IP range that the (A) pc, but both are in the same domain. I have access from one pc to another pc.

使用与本地PC(A)具有相同IP范围的另一台网络PC(C) 然后该exe可以正常工作.

With another network PC (C) with the same IP range than local pc (A) then the exe works.

我以这种方式进行了组装:

I made the assembly in that way:

create
SET GROUP=Import tool
SET GROUPDESC=Enabling fulltrust to TCImporter assemblies
SET CASPOL=%WINDIR%\Microsoft.Net\Framework\v2.0.50727\caspol.exe
%caspol% -polchgprompt off 
%CASPOL% -m -addgroup All_Code -allcode Nothing -name "%GROUP%" 

-description "%GROUPDESC%"
%CASPOL% -m -addgroup "%GROUP%" -strong -file .\TCImporter.exe 

-noname -noversion FullTrust -name "TCImporter" -description 

"fulltrust to TCImporter.exe" -exclusive on
%CASPOL% -m -addgroup "%GROUP%" -strong -file .\log.dll -noname 

-noversion FullTrust -name "log" -description "fulltrust to log.dll" 

-exclusive on
 %caspol% -polchgprompt on

,然后在执行exe时出现在(B)pc中的错误 (A)pc中的文件为:

and then the errors that appear in the (B) pc, when I execute the exe file in the (A) pc is:

log:ERROR [FileAppender]无法获取文件锁定 \ lbnf0052 \ TCImport \ log-file.txt.

log:ERROR [FileAppender] Unable to acquire lock on file \lbnf0052\TCImport\log-file.txt.

请求类型的许可 'System.Security.Permissions.FileIOPermission,mscorlib,

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib,

版本= 2.0.0.0,文化=中性,PublicKeyToken = b77a5c561934e089' 失败.

Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

log:ERROR XmlConfigurator:无法初始化配置文件

log:ERROR XmlConfigurator: Failed to initialize configuration file

文件[\ lbnf0052 \ TCImport \ TCImporter.exe.Config]的监视程序 System.Security.SecurityException:

watcher for file [\lbnf0052\TCImport\TCImporter.exe.Config] System.Security.SecurityException:

请求失败.在 System.Security.CodeAccessSecurityEngine.ThrowSecurityException(程序集 asm,授予PermissionSet,拒绝PermissionSet,RuntimeMethodHandle rmh,SecurityAction操作,对象需求,IPermission permThatFailed)

Request failed. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) at

System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object 屁股emblyOrString,授予PermissionSet,拒绝PermissionSet, RuntimeMethodHandle rmh,SecurityAction操作,对象需求, IPermission permThatFailed)

System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object ass emblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)

System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet 授予,PermissionSet被拒绝,PermissionSet要求, RuntimeMethodHandle rmh,对象assemblyOrString,SecurityAction 操作,布尔型throwException)

System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)

System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs,PermissionSet授予,PermissionSet被拒绝,PermissionSet 需求,RuntimeMethodHandle rmh,程序集asm,SecurityAction 动作)

System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)

log.Config.XmlConfigurator.ConfigureAndWatchHandler..ctor(ILoggerRepository 存储库,FileInfo configFile)

log.Config.XmlConfigurator.ConfigureAndWatchHandler..ctor(ILoggerRepository repository, FileInfo configFile)

at

log.Config.XmlConfigurator.ConfigureAndWatch(ILoggerRepository 存储库,FileInfo configFile)

log.Config.XmlConfigurator.ConfigureAndWatch(ILoggerRepository repository, FileInfo configFile)

失败的操作是:

LinkDemand

LinkDemand

第一个失败的权限的类型是:

The type of the first permission that failed was:

System.Security.PermissionSet

System.Security.PermissionSet

失败的程序集区域是:

内部网(当我更改某些内容时有时是MyComputer).

Intranet (this sometimes is MyComputer when I changed something).

推荐答案

可能是允许部分受信任的呼叫者 在http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx .

Might be the problem "Allowing Partially Trusted Callers " described in http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx .

按此处所述更改程序集属性 http://davedewinter. com/2009/05/21/the-allowpartiallytrustedcallersattribute-aptca-6/可能会为您修复.

Changing your assembly properties as described here http://davedewinter.com/2009/05/21/the-allowpartiallytrustedcallersattribute-aptca-6/ might fix it for you.

此外,签名似乎也会影响问题.

Also, signing seems to influence the problem.

此外,.net 4的行为有所不同: http://msdn.microsoft. com/en-us/magazine/ee336023.aspx .

Plus, .net 4 behaves differently: http://msdn.microsoft.com/en-us/magazine/ee336023.aspx.

这篇关于失败的动作是LinkDemand的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆