dotnet / project-system-tools

Tools for working with the C#/VB/F# project system.
MIT License
270 stars 42 forks source link

Feature to trigger a design-time build #491

Open gitfool opened 3 months ago

gitfool commented 3 months ago

@davkean Following up from my question on Twitter/X; it would be nice if there was a way to easily trigger a design-time build, specifically for debugging/logging design-time builds. As pointed out, currently the only way is indirectly by making the project dirty (adding/removing a file, editing a project, touching a file it's watching etc).

I'm happy to contribute if I could be pointed in the right direction.

drewnoakes commented 3 months ago

When I want to trigger a DTB I just add some whitespace to the project file.

If you wanted to add a feature for this, I'd be happy to review it.

I'd start by validating whether touching a project file triggers a DTB (i.e. not a content change, just a timestamp change). If content has to change, then it's less clear that this feature would work well as it'd leave the workspace dirty. If you changed the file then changed it back, there'd be two DTBs.

Then you'd want to validate which project types this feature would apply to. Just SDK-style projects? Legacy too? C++? JavaScript? etc... Ideally we'd be able to filter to just a relevant set of project types.

Finally you'd want to register a command with VS and have it carry out whatever action you need, again (ideally) only for supported project types.