-
Notifications
You must be signed in to change notification settings - Fork 392
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
Comments
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 |
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...) |
Oh really... I see, they managed to make it worse then 😅 Thanks for clarifying that. |
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. |
@drewnoakes would you mind sharing a link to where the I'd like to track that if possible. I see this item on the |
I don't know if there's a main issue. The work is being done across several products, from MSBuild to VS to CLI. |
Sorry for my insistence but i didn't fully understand... it seems to me that we have a "short circuit" between different MS teams (project-system and VS). AFAIU you are telling that from your point of view now only the legacy GUID is to be used because the new .slnx file format removes the GUID mess. I'm very happy to hear about the new .slnx file format BUT for now since the last VisualStudio (17.2.2) does not still support the .slnx format, we need to know if is really necessary to manually fix the sln files. Does using the legacy GUID instead the SDK style GUID have some consequence? |
Oof.... this is crazy. Encouraging people to touch the
It does but it is in preview. You need to enable it (it is disabled by default). Search for Once this is enabled, you can take a "legacy" solution and save it as a new The main problem is that while Visual Studio works fine with it, |
@julealgon I've taken a first look to the new .slnx format and it seems very promising: simple, clear, manually editable and no more unmergeable conflicts!!!! Unfortunately my real use case actually needs the |
Project System is part of VS, and we work closely with the Solution Experience team. We're on the same page about this.
Apologies for the confusion. I don't believe that's great advice there. The comment was provided in good faith by a support team member but is likely based on outdated info.
Overall, you generally don't need to think about these GUIDs. It was annoying when they would change in the solution file, but that should no longer occur. It doesn't really matter which of the two GUIDs you use in your When using the legacy GUID there's a bit of code in VS that scans the XML with a simple heuristic (not using MSBuild, just a SAX-based XML walk) to try and detect SDK-style projects. The only reason you'd ever need to use the newer GUID is if you're doing something really strange in your projects related to SDKs (like specifying them in |
@drewnoakes EDIT: just found this https://github.com/dotnet/project-system/blob/main/docs/opening-with-new-project-system.md#sdks that exactly respond to my question. About this point:
BINGO: my real case solution contains more than 200 projects and a typical
isn't this the "modern" way to go for a medium-high complex repo? I dislike the same configuration value spreaded across hundreds of files... IMHO it's a mess for maintainability and increases the risk for a false merge conflict.. So i hope the presence of |
The pattern |
@drewnoakes is there any performance penalty related to this additional XML scanning when using the legacy guids that could impact solution/project loading times and/or memory use in Visual Studio? |
It's negligible. Never appears on traces. |
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
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-guidsActual 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...
The text was updated successfully, but these errors were encountered: