NUnit.ConsoleRunner.Runner“System.Security.SecurityException:该程序集不允许部分信任的调用者”

时间:2014-01-20 14:56:34

标签: nunit-console

当我尝试从Mapped Network Drive

执行时,

nunit-console.exe会引发以下错误

 Unhandled Exception: System.TypeInitializationException: The type initializer for 'NUnit.ConsoleRunner.Runner' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
     at NUnit.ConsoleRunner.Runner..cctor()
  The action that failed was:
  LinkDemand
  The assembly or AppDomain that failed was:
  nunit-console-runner, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
  The method that caused the failure was:
  NUnit.Core.Logger GetLogger(System.Type)
  The Zone of the assembly that failed was:
  Internet
  The Url of the assembly that failed was:
  file:///Z:/jenkinsworkspace/workspace/FlashUpload/tools/NUnit/lib/nunit-console-runner.DLL
     --- End of inner exception stack trace ---
     at NUnit.ConsoleRunner.Runner.Main(String[] args)
     at NUnit.ConsoleRunner.Class1.Main(String[] args)**

我尝试在loadFromRemoteSources enabled="true"中添加nunit-console.exe.config,但这并没有解决问题。

1 个答案:

答案 0 :(得分:3)

将其添加到nunit-console.config文件中。

<supportedRuntime version="v4.0"/>

从这里得到这个: Get .NET to consider a specific network share to be fully trusted