我正在尝试在teamcity的构建步骤中构建.sln文件
但我在测试项目中遇到了错误(解决方案的一部分)
error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
我该如何解决?单元测试项目没有app.config,我可以编写类似
的内容 <assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
项目目标框架4.6.1。我想解决办法可能是在TC服务器上有C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1
和System.Runtime.dll
的文件夹,但我不确定。在TC服务器上,我的文件夹最高为4.5.2,本地最高为4.6.2,但在4.6.1中,我看不到dll - 仅在4.6中
更新
解决方案是安装开发包X版本并为X framework指定目标平台参数