gpt4 book ai didi

frameworks - 失败的操作是 LinkDemand

转载 作者:行者123 更新时间:2023-12-04 01:40:27 25 4
gpt4 key购买 nike

我有一个 exe 文件,当在本地 pc (A) 中执行时可以工作,但是当我在网络 pc (B) 中执行时,它没有。所在的文件夹该程序以正确的权限共享。唯一的事情是网络 pc (B) 与 (A) pc 不在同一 IP 范围内,但两者都在同一个域中。我可以从一台电脑访问另一台电脑电脑。

使用与本地电脑 (A) 具有相同 IP 范围的另一台网络电脑 (C)然后 exe 工作。

我是这样组装的:

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) 电脑中的文件是:

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

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

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

log:ERROR XmlConfigurator: Failed to initialize configuration file

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

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 ass emblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)

at

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

at

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

at

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

at

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

The action that failed was:

LinkDemand

The type of the first permission that failed was:

System.Security.PermissionSet

The Zone of the assembly that failed was:

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

最佳答案

可能是“Allowing Partially Trusted Callers”的问题"在 http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx 中描述。

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

此外,签名似乎也影响了这个问题。

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

关于frameworks - 失败的操作是 LinkDemand,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8215213/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com