question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove GUIDs from project files and references

See original GitHub issue

GUIDs are extremely unfriendly, and are only used for Visual Studio purposes. As we move the project file to a human editable file format, we should avoid using them.

There are three main ones today:

ProjectGuid property

<ProjectGuid>{8123135E-B2A1-4CD1-9658-DDACABEAB8FC}</ProjectGuid>

This is used as unique key of a project within a solution. First approach of removal should be to move this to an in-memory and solution-only concept.

Project metadata

    <ProjectReference Include="..\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj">
      <Project>{6c6a41ce-72c5-4d77-8208-d01693f9bc88}</Project>
      <Name>Microsoft.VisualStudio.ProjectSystem.Managed</Name>
    </ProjectReference>

Used by csproj/msvbprj to find the hierarchy of the project, introduced in VS 2010 release. I can’t find the history, but it appears that it may have been persisted so that if a project is renamed underneath the project (for example, if it was unloaded, or in a different solution), it can continue to find the old project.

CPS does not persist this today - so no work to do here.

ProjectTypeGuids property

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Used to indicate the project factories that should be used to open a project inside Visual Studio.

CPS completely removes the need for this, and this can be safely removed for projects that have opt’d into CPS.

Work required to pull this off:

  • Remove ProjectTypeGuids (CPS doesn’t have this concept)
  • Verify that CPS doesn’t persist <Project> metadata under a <ProjectReference>
  • Verify that if you open a project that doesn’t have a GUID, that it reuses the same GUID already persisted in the solution, and does not generate a new one.
  • Stop CPS from persisting the <ProjectGuid>
    • We should do this in a manner that means if we already have a GUID, we should continue to persist it/change it if the solution pushes us a new value so that it doesn’t get out of sync.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
davidfowlcommented, Jul 1, 2016

👏

1reaction
davkeancommented, Jul 5, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing Project Type GUID <ProjectTypeGuid>
I'd say removing this tag WILL cause problems for the team. One GUID identifies the language, another the type of project(class library, ...
Read more >
dotnet remove reference command - .NET CLI
The dotnet remove reference command provides a convenient option to remove project to project references.
Read more >
ProjectGuid keeps being removed from my projects
in our company we have ProjectGuid tags in wach project .csproj file for our CI/CD pipeline to run smoothly, unfortunatly every time I...
Read more >
Remove unreferenced files in Visual Studio projects
Remove references to missing files in visual studio – a simple PowerShell script to remove missing includes #VS #Visual Studio #csproj.
Read more >
Avoiding Broken References in Unity Projects
The top 3 causes of broken references in Unity projects. ... So, Unity is so good at managing meta files and GUIDs, how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found