我有引用一些.net框架库的ASP .net核心项目。我们想从.net framework 4.6升级到4.8。升级后,我得到了错误程序包xxx与netcoreapp2.2不兼容。该软件包引用了nuget的Newtonsoft.Json。
我发现问题出在某种程度上与对Newtonsoft.Json的引用有关。没有这个参考,它就可以正常运行。我可以通过以下步骤重现相同的错误:
当我将框架版本更改为4.6时,它可以正常运行。
答案 0 :(得分:0)
我将此添加到Web应用程序的csproj文件中,它解决了该问题:
$(AssetTargetFallback); net48; net461
答案 1 :(得分:0)
Is this the right way to add the AssetTargetFallback? Please suggest. Because I am still getting the same error.
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssetTargetFallback Condition="'$(TargetFramework)'=='netcoreapp2.2'">
$(AssetTargetFallback);net48;net461
</AssetTargetFallback>
</PropertyGroup>