Automating Visual Studio with EnvDTE

前端 未结 3 477
栀梦
栀梦 2020-12-13 02:27

I am successfully instantiating/automating Visual Studio using the following code:

System.Type t = System.Type.GetTypeFromProgID(\"VisualStudio.DTE.9.0\");
o         


        
3条回答
  •  萌比男神i
    2020-12-13 02:49

    I haven't had much luck with the IVSSolutionEvents technique (though I didn't try the code exactly as above). Instead, I created a small function to help me retry the call. I know that isn't particularly beautiful, but it is simple to call and it works!

    Here's a link to my answer to another, similar question: https://stackoverflow.com/a/8565990/1106459

    (It also helps with 'server busy' errors when calling other EnvDTE functions as well as opening and closing the solution.)

提交回复
热议问题