在TeamCity中运行MSpec构建步骤时,在Team City日志中出现以下错误:

[Step 7/7] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[17:07:13][Step 7/7] in directory: C:\TeamCity\buildAgent\work\726e90173bc65483
[17:07:14][Step 7/7] 2012-10-02 17:07:14,471 [4332] ERROR JetBrains.TeamCity.Utils.Runtime.ParseUtil - Failed to load assembly from file c:\mspec\mspec.exe: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
[17:07:14][Step 7/7] System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
[17:07:14][Step 7/7]    at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
[17:07:14][Step 7/7]    at System.Reflection.Assembly.LoadFile(String path)
[17:07:14][Step 7/7]    at JetBrains.TeamCity.Utils.Runtime.ParseUtil.LoadAssembly(String value) in c:\BuildAgent\work\e6509710c0972c73\src\Utils\src\Runtime\ParseUtil.cs:line 110

我对machine.config和MSpec配置文件进行了建议的修改,但似乎无济于事。
<runtime>
  <loadFromRemoteSources enabled="true"/>
</runtime>

MSpec运行程序正在在Visual Studio中在本地正确运行的生成代理上本地引用已编译的DLL。谁能解释此错误的含义以及如何解决该错误?

最佳答案

您是否可以检查mspec.exe或“已编译的DLL”的属性,以查看是否存在security Unblock button。我遇到了同样的错误,并且取消阻止修复了它。启用loadFromRemoteSources没有帮助。

关于teamcity - 为什么在TeamCity上运行MSpec时会收到NotSupportedException?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12694172/

10-08 20:41