Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old project type GUID are used for new projects/solutions #9601

Open
beppemarazzi opened this issue Nov 27, 2024 · 6 comments
Open

Old project type GUID are used for new projects/solutions #9601

beppemarazzi opened this issue Nov 27, 2024 · 6 comments

Comments

@beppemarazzi
Copy link

beppemarazzi commented Nov 27, 2024

Visual Studio Version

Version 17.12.2

Summary

C# projects targeting .net 9 are added to sln using "old" project type GUIDs

Steps to Reproduce

  1. Create a new console app c# project OR add a class library to an existing solution
  2. Open the .sln file with a text editor
  3. Look at the lines starting with Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ...

Expected Behavior

the project type GUID is expected to be Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = ... as documented here https://github.com/dotnet/project-system/blob/32c88de3973358cb38d78f78d7c7d1579fc0b4c6/docs/opening-with-new-project-system.md#project-type-guids

Actual Behavior

the project type GUID is Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ...

User Impact

don't know if it impacts someway.
But in my real case .sln i have hundred of projects with {9A19103F-16F7-4668-BE54-9A1E7A4F7556} and now (adding new projects with the just updated visual studio) i get the (bad?) {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}.

Does it have any impact? I don't know but just in case i'm manually "adjusting" the .sln file...

@julealgon
Copy link

This is not specific to .NET9. It apparently happens with any SDK-style project.

I've been fighting this for years now. The easiest way to fix the issue is to remove the project from the solution and re-add it. When it is added, it gets the correct GUID.

I hope the new slnx format is finished soon so that this dumb issue goes away along with the rest of the insanity that is the sln format.

@beppemarazzi
Copy link
Author

've been fighting this for years now. The easiest way to fix the issue is to remove the project from the solution and re-add it. When it is added, it gets the correct GUID.

probably it was true for old version of visual studio. With the latest update (17.2.2) also re-adding the project to the sln uses the "bad" GUID...

For me the only workaround is to manually edit the .sln file (I've also created a before build target that issue a compilation warning in case my .sln file contains an old GUID...)

@julealgon
Copy link

With the latest update (17.2.2) also re-adding the project to the sln uses the "bad" GUID...

Oh really... I see, they managed to make it worse then 😅

Thanks for clarifying that.

@drewnoakes
Copy link
Member

The back-and-forth between project type GUIDs for SDK-style projects should now be resolved, as part of work for SLNX. See #9509.

We now aim to use the same GUID everywhere (the legacy GUID), which should make things simpler to reason about.

@julealgon
Copy link

julealgon commented Nov 28, 2024

@drewnoakes would you mind sharing a link to where the .slnx work is being done? Ever since I first heard of it, I've been waiting for that to be released so that we can switch immediately to it on our side.

I'd like to track that if possible.

I see this item on the sdk repo. Not sure if it's the main issue though:

@drewnoakes
Copy link
Member

I don't know if there's a main issue. The work is being done across several products, from MSBuild to VS to CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants