How to open f开发者_如何学运维ile programmatically using EnvDTE in C#.
Assuming you have a hook to the correct DTE instance...
DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt");
You can try the following snippet directly in the Visual Studio Console:
$DTE.ItemOperations.OpenFile("c:\derp.txt",$DTE.Constants.vsViewKindTextView)
It should open the file as long as it exists...
精彩评论