-
Notifications
You must be signed in to change notification settings - Fork 389
MSBuild fails if assembly being tested references Microsoft.AspNetCore.Cryptography.KeyDerivation #166
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
Comments
This is another instance of the problem underlying issue #72 -- the Cecil rewrite with instrumentation needs access to a type definition from a dependency -- in issue #72 it was the NBitcoin assembly, and here it's 'Microsoft.AspNetCore.Cryptography.KeyDerivation, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' -- but can't find it. Unfortunately, nothing about this is logged when the process fails. For coverlet, the work-round is to run
which does the equivalent of a |
Thanks @SteveGilham - I can confirm that the work around you've provided works for the example I posted above and for the original project where we encountered the problem. |
@SteveGilham I have encountered a similar problem, after add I watched #72 ,I hope this issue will be resolved soon. |
Using .Net Core 3 preview 8. Neither of the property options mentioned are working.
MyProject.Test.csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../MyProject/MyProject.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.6.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeCoverage" Version="16.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.12.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="4.2.15" />
</ItemGroup>
</Project>
|
@tracker1 is your project a standard asp.net core one?I would like to repro your issue |
@MarcoRossignoli yes, I'm pretty sure I started with the dotnet new asp.net core template with core 3 preview 6, and upgraded to 8. |
@tracker1 I cannot repro in my local...can you attach your sample or put it in your repo so I can clone e test? |
@MarcoRossignoli I'll try to get it stripped out enough to be able to demo in a private repo and share it with you. |
@tracker1 any news...with 3.0 you should find dll directly to output folder and it should work https://github.com/dotnet/cli/issues/12705#issuecomment-535150372 |
Close because seem solved, I mean the above issue with reference not found. |
MSBuild fails if the assembly being tested references
Microsoft.AspNetCore.Cryptography.KeyDerivation
. The error is:Steps to Reproduce
Execute from CLI:
Replace the contents of
classlib/Class1.cs
with:Execute from CLI (should still be in
xunit-tests/
directory):dotnet test /p:CollectCoverage=true
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: