How to determine if Microsoft.VisualStudio.Web.CodeGeneration.Design is being used?

Viewed 143

I have a reasonable (although imprecise) idea as to what source generators do, but I have several projects in a solution that reference Microsoft.VisualStudio.Web.CodeGeneration.Design and the projects don't (to the best of my knowledge) have any source generators.

Given that this is source generation, I might be mistaken about the usage or it could be used indirectly. How can I determine whether it is safe to remove the reference? There isn’t anything else in the CodeGeneration namespace in the solution.

2 Answers

It's generally safe to remove a reference which doesn't prevent compilation when absent.

Microsoft.VisualStudio.Web.CodeGeneration.Design seems like a very weird thing to reference in a project - I believe it's used for generating the default code for views & controllers so I'm pretty sure it can be removed as long as it still compiles.

Related