How to open file programmatically using EnvDTE in C#

前端 未结 2 1702
一个人的身影
一个人的身影 2021-01-13 10:09

How to open file programmatically using EnvDTE in C#.

相关标签:
2条回答
  • 2021-01-13 10:28

    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...

    0 讨论(0)
  • 2021-01-13 10:40

    Assuming you have a hook to the correct DTE instance...

    DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt");
    
    0 讨论(0)
提交回复
热议问题