In Visual Studio 2012, I found it is possible to use DocumentSaved events from DocumentEventsClass. So I have written the following code in PowerShell.

$DTE.Events.DocumentEvents($DTE.ActiveDocument)

However, the COMObject returned is incorrect, (000... GUID). What am I doing wrong?

有帮助吗?

解决方案

To execute an action on Save, we found that the easy solution was to set a custom tool on the file. The same way RESX files work.

Basically, we added

MSBuild:CustomTarget

And this target will be called every time you save.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top