0

Actually editing *.cproj files manually, some code in the project template deletes my edits. So i'm forced to edit the file constantly before i build.. What way would you take to automate this:

  • is it possible to write a vs extension to have a custom tab in project options that reacts to checkboxes modifying project file for me
  • any other way?..

Thanks

Nick Kovalsky
  • 5,378
  • 2
  • 23
  • 50
  • 2
    Please state what you are modifying and what template you use. Otherwise, the issue you describe is not reproducible. – Martin Ullrich Apr 10 '19 at 11:03
  • Your inquiry is not related to my question. This is not about solving an issue this is about automating editing cproj files. – Nick Kovalsky Apr 10 '19 at 13:08
  • Your project files should NOT be changing at all, ever for builds. Don't put a band-aid on the problem, find out what is modifying your files and fix that. – C.J. Apr 10 '19 at 14:25
  • Thanks, it's not a problem for me, just want to add my custom code inside with some automation. – Nick Kovalsky Apr 10 '19 at 18:28

1 Answers1

1

automate editing project file

Something like a button or menu in VS, click it then some content which you used to add manually will be added into .proj file automatically? If I misunderstand, feel free to correct me:)

What way would you take to automate this:

Hard to say, but in short, I think it depends on whether you're experienced in extension development.

Since if you combine the functions into a extension. Every time when you want to add some custom changes to them, all you need to do is just click a button in VS or select a checkbox. It sounds good but the development of extension may take you some time and you may encounter some issues during the development.The journey could be challenging but instersting!

is it possible to write a vs extension to have a custom tab in project options that reacts to checkboxes modifying project file for me

It's absolutely possible.Just take a look at this extension,it provides a function which edit project in VS.

Not sure the details how your ideal extension is. But I think you may get some help below:

1.Extend menus and commands if you want to start the function by menu command.

Also, you may get some help from this issue which gives the suggestion about how to put function button under Add-node in solution explorer.

2.Assuming you have function code which adds content into a .xxproj file.(This part is about developing, add nodes to xml-based proj file?).Then add that code into a event handle which will be called when clicking the button or menu.(Something like this)

So I think it's possible but may take some time. And it will be the most automatic way but it takes some time to develop. Anyway, hope it helps and good luck with you.

LoLance
  • 25,666
  • 1
  • 39
  • 73