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
InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs' #587
Comments
You'll see any and all middlewares in the stack since that's how ASP.NET Core works - one calls the next. What you're seeing is quite a bit deeper and doesn't seem related - I'm wager if you remove MiniProfiler completely you'll see the same issue :) Given the rest of the stack, it seems like the compilation of a specific Razor view touching a type in that library/namespace for the first time is what's going boom. Perhaps the |
Oh one more thought, if you aren't referencing https://www.nuget.org/packages/System.Security.Cryptography.Pkcs/ directly, that may resolve it. I'm not sure what's leading to your missing ref, but a remedy to try if it is somehow an implicit runtime dependency not resolving at compile time. Alternatively, try compiling your views when compiling the project (this should be the default unless disabled). If the library is only pulled in via Razor, the package/DLL potentially isn't getting yanked into your |
@NickCraver - Thanks for the inputs, and you are completely right - removing MiniProfiler did not solve the problem. Also adding https://www.nuget.org/packages/System.Security.Cryptography.Pkcs/ did not solve the problem either. What fixed the problem is exactly this:
I copied |
On another note, I am actually not sure what component uses |
I'd expect this to crop up at build time but maybe something is doing dynamic shenanigans - are you building views when compiling? That should give a much more informative error :) |
Yes, views should be building when compiling / not turned off. I removed below condition for RunTimeCompilation but that did not solve problem either.
Checking
|
I'm joining the conversation as I'm experiencing the same issue. I've upgraded a web project from net5.0 to net6.0. I'm not using the MiniProfiler package, so I guess it not related to this project but to Razor Views instead. Maybe we should move this issue to the dotnet core repo? Here's my call stack for reference: InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs'
|
I agree. I will create an issue there. |
Thanks both! I'm not sure what the cause is here but the issue above is absolutely the way to go - I've poked who I know to look at this and get traction there. I'll close this out and subscribe to the aspnetcore issue as well - I'm curious what this is :) |
Just upgraded a web project to .NET 6.0. Project compiles but when I run the site I get the following error:
InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography'.
I am using MiniProfiler.AspNetCore.Mvc 4.2.2.
From stack below it is pointing to
dotnet/src/MiniProfiler.AspNetCore/MiniProfilerMiddleware.cs
Line 103 in a48fc7a
Stack:
The text was updated successfully, but these errors were encountered: