Questions tagged [projectitem]
13 questions
11
votes
1 answer
Finding a ProjectItem by type name via DTE
Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010.
The closest I could find is Solution.FindProjectItem, but that takes in…

Igal Tabachnik
- 31,174
- 15
- 92
- 157
5
votes
1 answer
No reference to project item created through AddFromTemplate() returned
In a Visual Studio Add-In that successfully creates a form, but gives me no reference back to the EnvDTE's prjItem instance.
Here's the piece of code that adds the form to the project:
string templatePath =…

JohnDoe
- 63
- 6
3
votes
1 answer
Problem using EnvDTE.Property.set_Value to set ProjectItem FullPath Property
I have a Visual Studio Project Wizard that attempts to configure a VC# project to override the FullPath property for selected files from the template.
The following code is used from within function
public void ProjectFinishedGenerating(Project…

user517041
- 41
- 4
3
votes
2 answers
How can I listen for the deletion of a ProjectItem via DTE?
I've got a designer that relies on the existence of other solution items. If one of those items is deleted the designer crashes and you have to edit as XML to fix. Not exactly user friendly.
I do, however, have the DTE object representing the…
user1228
1
vote
1 answer
How to determine the ProjectItem language type without opening the document in vsx?
When a file is open in the visual studio editor, through the EnvDTE.Document.Language property a string result such as "CSharp", "C/C++", "HTML", "JScript", etc. is returned specifying the language of a file. I'd like to be able to access that same…

Steve Cadwallader
- 2,656
- 4
- 28
- 37
1
vote
0 answers
Get file contents from ProjectItem in Visual Studio 2015 extension
Is it possible to access the contents of a ProjectItem object? Is there an alternative for going via ProjectItem.Properties and read the contents from the FullPath?

Elsbeth
- 75
- 5
1
vote
1 answer
Parsing code-model from in-memory C#-code string
With EnvDTE.ProjectItem, is it possible to parse an in-memory C#-code string to get the FileCodeModel?
I don't want to alter the project file in this course by adding a temporary file to project, get its ProjectItem, do stuff and then delete the…

Annie
- 3,090
- 9
- 36
- 74
1
vote
1 answer
Getting code from all (closed) files in solution in Visual Studio SDK
I'm trying to get and edit the code of all the html-files in the project
i found a way to loop over all ProjectItems
IEnumerator Projects = _applicationObject.Solution.Projects.GetEnumerator();
while (Projects.MoveNext())
{
IEnumerator Items =…

Berty
- 1,081
- 1
- 18
- 49
0
votes
1 answer
File referenced by ProjectItem is not created when new Project created
Trying to create my first Project Template for a simple VS2015 C# project. But when I try to create a Project with it, one of the files - post_build.bat - is missing.
The content of the project template ZIP file is:
AssemblyInfo.cs
…

user2577528
- 23
- 6
0
votes
1 answer
Adding controls to a form when I only have the reference to it’s EnvDTE
I am writing na Add-In for Visual Studio 2010, and I want it to add controls to an existing Form in an existing Project in an existing Solution, and I already have references to all of them.
As I have the reference to the Project Item that…

JohnDoe
- 63
- 6
0
votes
1 answer
ItemAdded Event in Visual Studio: Get item AND project
I develop a tool, which recognize changes made in a Visual Studio solution.
Therefore, I use dte Events like
solutionEvents.ProjectRemoved += cV.OnProjectRemoved;
solutionEvents.ProjectRenamed += cV.OnProjectRenamed;
projectItemsEvents.ItemAdded +=…

user2550641
- 317
- 4
- 18
0
votes
1 answer
How to change item properties programmatically (Content Processor XNA 4.0 )?
I need to change the content processor of my models programmatically or the fbx file property (XNA Framework Content Pipeline->Content Processor) from the solution/project because of the custom content processor.
And that's all because I want the…

AbdelRahman Badr
- 193
- 3
- 15
0
votes
1 answer
How to get the full filename from ProjectItems?
My code, which has been working right on another computer fails at FullPath and FileName points. The error is:
'object' does not contain a definition for 'FullPath' and no extension method 'FullPath' accepting a first argument of type 'object'…

user3088020
- 3
- 1