I am trying to figure out how to change a portable .net class library into a .net platform standard library. There is a clickable link in the project settings that looks right it says "Target .net platform standard".
The error which seems absurd to me is:
The project's targets cannot be changed. The selected targets require the project to opt-into NuGet 3.0 support, however, Visual Studio cannot automatically do this for you. Please uninstall all NuGet packages and try again.
Is there any way to do this that makes more sense than the absurd approach above of literally deleting all my references and then trying to add them back? I don't know how to take this project which I didn't write and convert it to to .net standard other than write all the references down on a piece of paper and then try to add them back again. Is that literally what I'm being told to do? Is there another way? Am I doing this wrong?
Secondly, even when I remove all references that can be removed, the project still won't convert. I removed Newtonsoft and all other references that can be removed, leaving only .net, system, and system.core, which are not removable.
I still get the same absurd error. The project I'm trying to modify is an open source project available on github, but I'm purposely trying to make this question more general so it could be useful to others who run into this "Target .net platform standard doesn't work at all" issue.
NET Standard is a set of curated APIs, picked by Microsoft, PCLS are not. The APIs that a PCL contains is dependent on the platforms that you choose to target when you create a PCL. This makes a PCL only sharable for the specific targets that you choose.
Article. 07/12/2021.
I struggled a lot with the exact same problem: The solution which worked best was the one provided by @Jasper H Bojsen
So I had to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With