简体   繁体   中英

VSIX Package and .NET5 project

I'm creating a VSIX project to read all the Config.xml files in the solution to generate many files within each project.

I'm having difficulty finding the Config.xml file inside a project and I believe it is because of the new Asp Net 5 project structure.

dte.Solution.Projects.Item(1) returns the "src" folder.

dte.Solution.Projects.Item(1).ProjectItems.Item(1).Name will return the project folder.

Then I cannot go any deeper inside the project because the item returned for the project is a ProjectItem and not a Project. ProjectItems do not have items.

How can I get a specific file in my project under asp net 5? I am currently using a "Tools > Command" to execute the code. Would an project and/or xml file right click context menu fix this? If so how would I implement that?

Use the ProjectItem.SubProject property. See an example here:

HOWTO: Navigate the files of a solution from a Visual Studio .NET macro or add-in

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM