I was following a tutorial on Pluralsight about having an MSTest project target both .net core 2.2 AND .NET 4.7.2. This required going to my .csproj file for my test project and editing it so that the following:
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
...
would change to become TargetFrameworks (that's plural now) and then we add in the .NET 4.7.2 moniker, as follows:
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;net472</TargetFrameworks>
...
As soon as I saved the .csproj file, VS 2019 showed the following error in a yellow bar at the top:
The project ran into a problem during the last operation: The value of the 'TargetFrameworkMoniker' and 'NuGetTargetMoniker' properties in the 'Debug|AnyCPU' configuration are both empty. This configuration will not contribute to NuGet restore, which may result in restore and build errors.
What am I doing wrong?
For me, the error went away when I closed Visual Studio and opened the solution again
With Visual Studio closed, removing the .vs
folder in the solution root solved it for me.
I just face this problem for .net core where SDK version was specified as "3.0.103". I just change it to my PC installed .net core version "3.1.300" in global.json file. It worked.
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