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
Fix TestPlatform.ObjectModel reference #100
Conversation
|
Remove the Microsoft.VisualStudio.TestPlatform.ObjectModel.dll I don't think it's a fair test. Microsoft.VisualStudio.TestPlatform.ObjectModel.dll may or may not exist. For our test csproj, we add a reference to <PackageReference Include="Machine.Specifications" Version="1.1.0-beta.3" />
<PackageReference Include="Machine.Specifications.Runner.VisualStudio" Version="2.11.0" />
<PackageReference Include="Machine.Specifications.Should" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> But the Microsoft.NET.Test.Sdk doesn't copy the Microsoft.VisualStudio.TestPlatform.ObjectModel.dll in so DevOps / dotnet test fails |
This is by design, the ObjectModel dll is part of the dotnet test harness and doesn't need to be present for the runner to function. This sounds very similar to the xunit issue over here xunit/xunit#1852 and is a problem when a test inadvertently loads the MSpec runner dll. |
It is related. We could add |
Force 16 for non net 452 users
No, it isn't wrong to catch V11 is used for backwards compatibility, since we are still supporting .net4 versions. |
They added it in the test library. |
Just for info, this would fix the Assembly load issue. |
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Outdated
Show resolved
Hide resolved
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Outdated
Show resolved
Hide resolved
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Outdated
Show resolved
Hide resolved
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Outdated
Show resolved
Hide resolved
move to lib folders to avoid package warnings
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Outdated
Show resolved
Hide resolved
Think this is ready now |
...Machine.Specifications.Runner.VisualStudio/Machine.Specifications.Runner.VisualStudio.csproj
Show resolved
Hide resolved
Amazing, thank you |
Using net 4.7.2, dotnet test
Given we use
AppDomain.CurrentDomain.GetAssemblies();
The TestAdapter has a Machine TestAdapter 2.10.1 references v11 of VS Object Model.
This throws:
This ONLY happens when using dotnet / vstest console, not within the IDE
We can now remove net452
(Mono.Cecil can always be included to make the packaging logic easier)