当前位置: 首页 > 知识库问答 >
问题:

为什么在TeamCity上运行MSpec时会出现NotSupportedException?

吕文林
2023-03-14

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

[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

我已经对机器做了建议的修改。config和MSpec config文件,但它似乎没有帮助。

<runtime>         
  <loadFromRemoteSources enabled="true"/>
</runtime>

MSpec运行程序正在本地引用构建代理上的编译DLL,该构建代理在Visual Studio中本地正确运行。有人能解释这个错误的含义以及我如何解决它吗?

共有1个答案

于高雅
2023-03-14

你能检查mspec.exe或"编译DLL"的属性,看看是否有安全的Unblock按钮。我有同样的错误,Unblock修复了它。启用loadFrom远程资源没有帮助。

 类似资料:
  • 我最终得到了一个500的错误,这取决于stacktrace,这可能是一个数据格式错误,但我所有的变量都是字符串,所以我根本看不到错误在哪里。此外,我的连接jdbc很好,因为在调试模式下,我可以看到数据库的值,但一旦它进入JSP中,它就不再工作了。你能帮帮我吗? servlet JSP 豆类 BDD连接 堆栈跟踪 我的servlet:

  • 我想在RxJava中实现一个下载一些文件的处理队列。我想下载的文件数量可能高达100个左右。 一切都是在Android上使用RxJava 1.1.1开发的 我做错了什么?

  • 我已经调整了控制器构造函数和fxml,所以除了fxml构造和fxml加载之外,控制器的所有fxml设置都在fxml中。这里是我的控制器:

  • 问题内容: 当我运行以下代码时: 我得到一个异常说: 为什么会出现此异常? 编辑:tmpList是一个LinkedList,其每个节点都包含DepConfAttr类型的对象。 我正在基于内存(首先是最高内存)对tmpList进行排序,这是DepConfAttr对象的属性之一。 上面的代码反映了我要通过以下代码实现的目标 问题答案: 为什么会出现此异常? 您要遍历列表,而不是通过迭代器从列表中删除一

  • 运行单个测试时引发错误: 通过点击方法名称旁边的绿色三角形按钮启动测试。 但是如果你通过maven(生命周期)对整个项目进行测试- 要使用JUnit,需要使用以下依赖项: 负责这个项目的其他团队成员(一个存储库,不同的分支)没有这样的问题。是什么导致了这个错误?使用了IDE-IntelliJ IDEA UPD:我什么都试过了。删除。idea文件夹没有效果,也没有重新下载所有依赖项。清除缓存也没有效

  • 问题内容: 我正在使用ant生成javadocs,但是一遍又一遍地获取此异常-为什么? 我正在使用JDK 1.6.0_06 版本。 问题答案: 看来这已被报告为Java错误。这似乎是由于使用了第三方库(例如JUnit)中的注释,而在Javadoc调用中不包含带有该注释的jar。 如果是这种情况,只需在javadoc上使用-classpath选项并包括额外的jar文件。