0

I have some code that sets the "Name" property to change the extension to some file

ProjectItem pi = //...
/* snip */
pi.Name = "file.with_new_extension";

As soon as the assignation happens, the code pauses, because in the UI Visual Studio is asking confirmation:

"If you change a file name extension, the file may become unusable. Are you sure you want to change it?."

Is there any way to stop this confirmation to happen?

  • @binaya please review [why your edit was incorrect](http://stackoverflow.com/review/suggested-edits/4697168), mkay? –  May 01 '14 at 15:19

1 Answers1

0

Well, it was rather simple, using this property http://msdn.microsoft.com/en-us/library/envdte._dte.suppressui.aspx like

DTE.SupressUI = true;

Before setting ProjectItem.Name, silenced Visual Studio UI.