How to open a file programmatically using EnvDTE in C #

How to open a file programmatically using EnvDTE in C #.

+3
source share
2 answers

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

DTE.ExecuteCommand("File.OpenFile", "c:\\derp.txt");
+8
source

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
source

Source: https://habr.com/ru/post/1792994/


All Articles