【发布时间】:2012-10-02 16:14:26
【问题描述】:
在 TeamCity 中运行 MSpec 构建步骤时,我在团队城市日志中收到以下错误:
[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。谁能解释这个错误的含义以及我如何解决它?
【问题讨论】:
-
在您的 TeamCity 日志中,我看到它记录了
NUnitLauncher,对吗? -
您是否为您的目标框架使用了正确的
mspec.exe?您究竟是如何从命令行在本地运行的?您在 Visual Studio 中的运行情况如何(使用 TD.NET 或 ReSharper)?