-
Notifications
You must be signed in to change notification settings - Fork 4.9k
.Net Core 2.0.0-preview1-final Nuget cannot be installed on .Net Standard 2.0 class library #700
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This is because in Preview1 of ASP.NET Core 2.0, didn't support .NET Standard because it used API's that weren't available. In Preview2, I believe it will. |
@Petermarcu , I think it is still not in preview 2... |
In Preview2 ASP.NET moved back to .NET Standard. I'm not sure if there were specific libraries that couldn't. @DamianEdwards do you know? |
|
I don't know much about those packages. @DamianEdwards do you? |
@Ponant do you have a minimal repro that you can post to GitHub? |
@davidfowl , I need to strip out my project; give me some time. |
@davidfowl , see class1, CryptographyAlgorithms is not recognized. |
@Ponant Where's the project that fails? Can you write some instructions on how to reproduce the problem? |
If you open the project and goto class1.cs, you should see the CultureCryptoService class that CryptographyAlgorithms "does not exist in the current context". Whereas I installed the preview 2 antiforgery nuget. |
@Ponant the project you put on github doesn't have any package references: I'm still not clear on what you're expecting. Did you mean to add some package reference? |
OH that is strange, probably an upload issue. Here is my csproj on my desktop
|
@davidfowl , to answer your question, what I expect is CryptographyAlgorithms.cs to be public. |
That type isn't in the preview2 version of the It was in 1.1.x - It's missing from preview2 - https://github.com/aspnet/Antiforgery/tree/rel/2.0.0-preview2/src/Microsoft.AspNetCore.Antiforgery/Internal It's back in dev - https://github.com/aspnet/Antiforgery/tree/f292fa8db5fbf89ab80eaff7f4c8a469fbe6813b/src/Microsoft.AspNetCore.Antiforgery/Internal These types are what we call "pubternal" they're not real public API, so they can go missing from version to version that's why they are in an "internal" namespace. However, they can be useful if you're on a particular version of the framework. |
Are they expected to be in 2.0? thanks |
@Ponant you might be better off calling |
I have a class library created with VS 2017 and .Net Core Preview 1 and targeting .Net Standard 2.0 and it has the following NuGets in addition to the standard library
Both cannot be upgraded to
.Net Core 2.0.0-preview1-final
and I receive as VS outputPackage Microsoft.AspNetCore.Antiforgery 2.0.0-preview1-final is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Microsoft.AspNetCore.Antiforgery 2.0.0-preview1-final supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)
The problem is that I have a web app using
Microsoft.AspNetCore.Antiforgery 2.0.0-preview1-final
and referencing my library. This results in
TypeLoadException: Could not load type 'Microsoft.AspNetCore.Antiforgery.Internal.CryptographyAlgorithms' from assembly 'Microsoft.AspNetCore.Antiforgery, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Is this expected and is there a workaround?
To make it work so far I had to copy/paste the raw code from
CryptographyAlgorithms
directly into my class library, but that is obviously not the best thing to do.The text was updated successfully, but these errors were encountered: