I'd like to create a custom MSBuild task and distribute it as a NuGet package. To enable my task, the visual studio proj file should be modified.
Is it possible to add my code sections to the proj file when installing the NuGet package?
You can do this using Powershell. It is possible to unload you project, edit the project file and reload the project.
Scott Hanselman did this here: http://channel9.msdn.com/Events/MIX/MIX11/FRM09
If you find a package that does what you want, you can open the nuget package using ZIP and see the powershell scripts. Thats a good starting point to learn that stuff.
hope that helps
I think you are better off using the NuGetPowerTools package as answered in this question:
Adding a custom build step with a nuget package
This package handles all the Visual Studio automation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With