3

Empty standard lib (but with enabled multitargeting):

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.1; netstandard2.0</TargetFrameworks>
  </PropertyGroup>

</Project>

compiles but

create the message.

enter image description here

"The value of 'TargetFrameworkMoniker' and 'NuGetTargetMoniker' properties i th 'Debug|AnyCPU' configuration are both empty. This configuration will not contribute to NuGet restore, which may result in restore and build error. You may need to reload the solution after fixing the problem"

What I should add to configuration to get it working?

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
  • Does this solution apply/help? https://stackoverflow.com/questions/57981214/error-when-changing-to-targetframeworks-plural-in-net-core-csproj-file – mmas0-n Sep 28 '19 at 15:14
  • I do not understand how I can apply them. I have a class library (empty) without web.config or app.config. – Roman Pokrovskij Sep 28 '19 at 17:11
  • 1
    But it seems project reload helps...Can't uderstand what is going here. Project file is primitive, what could going wrong there? NUGET package is even not configured for the lib. – Roman Pokrovskij Sep 28 '19 at 17:15
  • 3
    What's going on is -- apparently in VS2019 they added support for multi-target packages, but they didn't add support for changing a project from single target to multi-target with a text editor while VS2019 was running, and then when VS2019 asks if you want to reload the project, you say yes. If you restart Visual Studio and then load the project again, the problem will go away. – Jean Libera Feb 04 '20 at 14:07

0 Answers0