简体   繁体   English

在Visual Studio中创建单元测试后无法构建项目吗?

[英]Project not building after creating unit tests in visual studio?

A product with lot of interdependence among projects. 项目之间具有很多相互依赖性的产品。 Initially creating unit test for one project. 最初为一个项目创建单元测试。 Successfully able to create tests and using InternalsVisibleTo() for accessing non-public class members of that project. 成功创建测试并使用InternalsVisibleTo()访问该项目的非公共类成员。 But when I build the project, because it has dependencies its throwing errors. 但是,当我构建项目时,由于它具有依赖性,因此会引发抛出错误。 Before creating tests there were no errors. 在创建测试之前,没有错误。

List of errors: 错误清单:

Failed to load '..\\xxx1.dll' because it is not a valid .NET assembly : RegAsm 无法加载'.. \\ xxx1.dll',因为它不是有效的.NET程序集:RegAsm

The command "%SystemRoot%\\Microsoft.NET\\Framework64\\v4.0.30319\\regasm" xxx1.dll /tlb:"..\\xxx1.tlb" /verbose" exited with code 100. 命令“%SystemRoot%\\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ regasm” xxx1.dll /tlb:"..\\xxx1.tlb"/verbose退出,代码为100。

The output property is not set for the project. 没有为项目设置output属性。 Please check to make sure you have specified valid combination. 请检查以确保您指定了有效的组合。

Solved after changing "Solution platforms" to "x64". 将“解决方案平台”更改为“ x64”后解决。 Since one project among dependencies was indirectly depending upon a project that needs to be build for x64 machine. 由于依赖项中的一个项目间接依赖于需要为x64机器构建的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM