0

I'm using dte in order to get the path to a file I right-clicked on in VS extension. I used SelectedItems like in here: SelectedItem.DTE Property

However, the Project field is always null when testing. I'm testing on another solution in which I added a file with Add->Add Existing item into a project, so I don't see any reason why it return null. Had it happened to someone? How can I get the full path of the selected item then?

EDIT: code example of what I want to do

selItem = dte.SelectedItems.Item(1);  
var t = selItem.Name;   // this works fine
var t2 = selItem.Project;  // this return null
var t2= selItem.ProjectItem;  // this also return null

0 Answers0