Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build warning on build of default xunit template (netcore) #393

Closed
codito opened this issue Jan 29, 2017 · 1 comment · Fixed by #444
Closed

Build warning on build of default xunit template (netcore) #393

codito opened this issue Jan 29, 2017 · 1 comment · Fixed by #444

Comments

@codito
Copy link
Contributor

codito commented Jan 29, 2017

Description

Building the default xunit test project shows an warning on dependency resolution conflict.

Reported by José Manuel Nieto Sánchez in developer community

Steps to reproduce

  1. Create a new xunit test project (netcore)
  2. Build the project

Expected behavior

Build succeeds without warning.

Actual behavior

Build succeeds with warning.

Build started, please wait...
C:\Program Files\dotnet\sdk\1.0.0-rc3-004530\Microsoft.Common.CurrentVersion.targets(1912,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [C:\temp\test\test.csproj]
Build completed.

Test run for C:\temp\test\bin\Debug\netcoreapp1.0\test.dll(.NETCoreApp,Version=v1.0)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
Passed   Tests.UnitTest1.Test1

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1,7098 Seconds

Environment

Microsoft.NET.Test.Sdk: 15.0.0-preview-20170125-04

@codito
Copy link
Contributor Author

codito commented Jan 29, 2017

TestHost doesn't declare the dependency on Microsoft.Extensions.DependencyModel in nuspec, as a result, this dependency is not resolved at restore. At runtime, there are two different versions of DependencyModel being used, hence the conflict.

Excerpt from msbuild log:

1>    There was a conflict between "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
1>        "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
1>        References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [C:\Users\armahapa\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll].
1>            C:\Users\armahapa\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
1>              Project file item includes which caused reference "C:\Users\armahapa\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll".
1>                C:\Users\armahapa\.nuget\packages\microsoft.extensions.dependencymodel\1.0.0\lib\netstandard1.6\Microsoft.Extensions.DependencyModel.dll
1>        References which depend on "Microsoft.Extensions.DependencyModel, Version=1.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
1>            C:\Users\armahapa\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170106-08\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll
1>              Project file item includes which caused reference "C:\Users\armahapa\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170106-08\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll".
1>                C:\Users\armahapa\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170106-08\lib\netstandard1.5\testhost.dll
1>                C:\Users\armahapa\.nuget\packages\microsoft.testplatform.testhost\15.0.0-preview-20170106-08\lib\netstandard1.5\Microsoft.TestPlatform.CrossPlatEngine.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants