.net - NuGet package manager marks target platform as unsupported -
i've created nuget package .net standard 1.3 library. package definition in csproj file:
<project sdk="microsoft.net.sdk"> <propertygroup> <summary>my package</summary> <description>my package description</description> <versionprefix>1.0.0</versionprefix> <authors>opensoft inc.</authors> <targetframeworks>netstandard1.3;</targetframeworks> <netstandardimplicitpackageversion>1.3</netstandardimplicitpackageversion> <targetframeworkidentifier>.netstandard</targetframeworkidentifier> <targetframeworkversion>v1.3</targetframeworkversion> <nowarn>$(nowarn);1591</nowarn> <treatwarningsaserrors>true</treatwarningsaserrors> <generatepackageonbuild>true</generatepackageonbuild> <assemblyname>testassembly</assemblyname> <packageiconurl></packageiconurl> <packageprojecturl></packageprojecturl> <assemblyversion>1.0.0.0</assemblyversion> <fileversion>1.0.0.0</fileversion> </propertygroup> <itemgroup> <packagereference include="newtonsoft.json" version="10.0.3" /> <packagereference include="system.xml.xmlserializer" version="4.3.0" /> </itemgroup> </project>
but after publishing package, can't reference correctly .net framework 4.6.1 web application project. says target platform unsupported.
what doing wrong?
it looks got stray property definitions in csproj file.
remove properties targetframeworkidentifier
, targetframeworkversion
netstandardimplicitpackageversion
.
only keep targetframeworks
(and remove stray ;
@ end), , let tooling job figure out correct values other properties able publish correct nuget package.
note if publish "corrected" package, need either change version number or clear local package cache on machines downloaded corrupt package (=> dotnet nuget locals --clear
).
Comments
Post a Comment