[ACCEPTED]-InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs'-miniprofiler

Accepted answer
Score: 12

The fix: Add the following configuration setting 4 to your .csproj file.

<GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>

It seems that this 3 issue is most likely related to a breaking change with .NET 6.0 which was not documented. It 2 worked for me, without adding/removing any 1 of the above mentioned libraries.

Score: 2

It turns out it had nothing to do with MiniProfiler. Instead, @NickCraver 5 suggested that https://www.nuget.org/packages/System.Security.Cryptography.Pkcs/ was not copied to the bin folder. After 4 copying the DLL manually, project runs again.

Next 3 challenge, is that I am not using the DLL 2 directly in the code, so perhaps it is some 1 older NuGet that is referencing it.

https://github.com/MiniProfiler/dotnet/issues/587

More Related questions