-
Notifications
You must be signed in to change notification settings - Fork 331
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
"no source available" when targeting net462 #523
Comments
FYI: You can use the RTM bits of xUnit.net (released a few hours ago). The experience is exactly the same. |
Related to: #373 Work around: Add following PropertyGroup to csproj.
|
Fixed in |
I'm still having this issue. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="Moq" Version="4.7.1" />
<PackageReference Include="FluentAssertions" Version="4.19.2" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project> "No source available" for tests, no code-coverage and no context-awareness when trying to run test from the editor. |
known issue xunit/xunit#1140. For No source available and no code-coverage, I am not able to repro it on VS 15.0.26228.4, can please provide additional data.
|
@smadala VS build: 15.0.0+26228.9 I've just spend two hours trying to reproduce the error in a new solution. Finally did it. It's really weird. You have to have a test class, that inherits from a super-class with a generic type-parameter. The generic-type supplied to the super-class then have to be a MVC controller. When all that is true and you mark a test method async, then the error occurs.... You can find a test-solution here: https://github.com/anderslm/Testing P.S. |
@anderslm Thanks for sample project, I'm able to repro it. But for similar test method MSTest |
Theory: Given the description, it sounds like there is probably a dependency lookup failure when getting source information, presumably because the MVC assembly is not loaded into that source info app domain. |
Apparently there is VS tests bug that prevents test explorer from showing source information otherwise. See microsoft/vstest#523.
From this issue here: xunit/xunit#1112
When I create a new xUnit test project in VS2017 RC4 (or newer), test Explorer cannot show the source code for any of the tests. When targeting netcoreapp1.1 (which is there by default in the template, it works as expected.
csproj file
UnitTest1.cs file:
We dug into this and found out that
Microsoft.VisualStudio.TestPlatform.ObjectModel
is missing from the host process when run. That means that we cannot get an instance ofDiaSession
. The test host has to inject the correct version of the library from a location also containingmsdia140typelib_clr0200
. It does this for the legacy project system./cc @bradwilson
The text was updated successfully, but these errors were encountered: