3

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但这并没有解决问题。

4

1 回答 1

3

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

<supportedRuntime version="v4.0"/>

从这里得到这个: 让.NET考虑一个特定的网络共享是完全信任的

于 2014-02-18T22:01:47.410 回答