Dynamically create a VS project

I have a project in which I create WiX (Windows Installer for XML) files, if they are not already present. It works great. Now I want to expand it to add more functionality. I was wondering if there is a way to create a Visual Studio project programmatically? This project starts as part of our nightly build process, and when you need a new wix file, it is created, but I want everything to be in place when the build is complete, so if necessary, you can simply open the project in Visual Studio and start editing. Have I heard outside the realm of opportunity or not? Any push in the right direction would be greatly appreciated.

+4
source share
2 answers

Project files are xml, so there is no reason why you could not (hard way)

There are Visual Studio APIs for creating projects Practical project management

+5
source

In general, I do not think this is a good idea. While I am a proponent of complete completion automation, the installer is the source, and any changes to it must be made intentionally. I do not like the face into which files enter and exit the installation. If the product adds a file, it must be explicitly added to the installer, and if the file is deleted, it must be explicitly deleted from the installer. Any change in this baseline without a change in reaction should lead to a break in the assembly.

This is IMO, the only way to be 100% sure that what is included in the installation is intentional and accurate.

+1
source

Source: https://habr.com/ru/post/1306468/


All Articles