Reputation: 109792
If I am multitargeting a project to .Net Core 3.1 and .Net Framework 4.8 and I select Debug | Start Debugging, Visual Studio 2019 starts a debugging session with the .Net Framework build target.
How can I get it to launch the .Net Core build target instead?
Here is my test project file:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net48;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
And here is the test code:
using System;
namespace Demo
{
class Program
{
public static void Main(string[] args)
{
#if NET48
Console.WriteLine(".Net Framework");
#else
Console.WriteLine(".Net Core");
#endif
}
}
}
There are no other files in the project. I'm using Visual Studio 2019 version 16.7.2.
Upvotes: 9
Views: 2800
Reputation: 174
There is also a dropdown to update the preview in the editor. You can find it under tabs view. If you will change the selected value, the syntax highlight under #if #else updates
Upvotes: 1
Reputation: 81553
Just to make it obvious, If you click the dropdown next to your start debug toolbar item, you will see your targeting options
Note : I am trying to find the actual documentation for this... zilch
Upvotes: 19