-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
Visual Studio Preview suddenly fails to build in all sorts of interesting ways on code that used to work perfectly well in .NET 6. Any project with a <TargetFrameworks> tag in its csproj rather than a <TargetFramework> tag is barfing everywhere.
To Reproduce
- Setup .NET 7 RC1 on the latest Visual Studio Preview, using the links found on this announcement.
- Create a new solution with two new projects, for .NET 7. Project 2 should have a dependency on project 1 and should use a type declared in project 1.
- Alter project 1's csproj to say
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>rather than net7.0` - Try to rebuild the solution. Watch as everything goes wrong.
Expected behavior:
This was working fine in .NET 6. It should continue to work fine in .NET 7.
Observed behavior:
First, Visual Studio complains about TargetFrameworkMoniker and NuGetTargetFrameworkMoniker properties being missing from the project. Then you manually rebuild project 1 and it works, but when you try to rebuild project 2, it has trouble with the types declared in project 1. VS very helpfully suggests adding a reference to project 1, even though project 2 already has one. An option to do so even shows up in the relevant ALT-ENTER popup menu. Selecting this option does nothing.
How did such a massive regression in such a basic piece of functionality end up in an RC?!?