Msbuild VS2017发现“的不同版本之间存在冲突”;系统运行时“;这是无法解决的

Msbuild VS2017发现“的不同版本之间存在冲突”;系统运行时“;这是无法解决的,msbuild,visual-studio-2017,xunit,Msbuild,Visual Studio 2017,Xunit,我有一个包含3个项目的Visual Studio 2015解决方案,然后开始使用VS 2017添加2个新的xunit项目。当我构建所有东西都成功了,但是测试正在测试资源管理器中被发现 我回顾了这个问题,并将构建输出设置为Diagnostic,我收到一条警告: 1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.t

我有一个包含3个项目的Visual Studio 2015解决方案,然后开始使用VS 2017添加2个新的xunit项目。当我构建所有东西都成功了,但是测试正在测试资源管理器中被发现

我回顾了这个问题,并将构建输出设置为Diagnostic,我收到一条警告:

1>  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Runtime" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
  • 我已从更新了3.csproj文件
    项目工具version=“14.0”
    项目工具version=“15.0”

  • true
    添加到2个VS2017项目中,但该项目没有

  • 将测试->测试设置->默认处理器架构设置为x64,将我的构建->配置管理器->平台设置为x64或任何CPU(某些项目不允许x64?)

  • 我已通过
    更新包-重新安装

  • 更新并修复了VS2017

我可以在解决方案加载时看到我的测试,但是一旦我构建了解决方案,测试就会变灰。然后我试着运行一个,他们说

4/4/2018 4:34:25 PM Warning] Test run will use DLL(s) built for framework Framework45 and platform X86. Following DLL(s) will not be part of run: 
DatabaseRestoreManager.exe, RestoreBaseLib.IntegrationTests.dll, RestoreBaseLib.Tests.dll, RestoreBaseLib.dll, Restores.exe are built for Framework Framework45 and Platform X64.
 Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
[4/4/2018 4:34:26 PM Warning] [xUnit.net 00:00:00.1993869] Exception discovering tests from RestoreBaseLib.IntegrationTests: System.BadImageFormatException: Could not load file or assembly 'RestoreBaseLib.IntegrationTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'RestoreBaseLib.IntegrationTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
大多数有此问题的人似乎在nuget软件包中都有此问题,但我的问题似乎是msbuild或VS15到VS17的升级,带有测试和
System.Runtime


有什么办法可以解决这个问题吗?我希望能够在VS17中运行xunit测试。

将项目设置为x64或任何不适合您的CPU?如果可能,您可以检查此线程:您已经解决了该警告吗?我有同样的警告,但在我的例子中,我没有任何测试项目,只有两个项目:一个应用程序和一个类库