将导入添加到项目文件

将导入添加到项目文件

本文介绍了将导入添加到项目文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个解决方案向导,在其中添加了几个项目.其中之一是WiX项目,为此我需要在项目文件中添加另一个导入标签.我怎么做?在我的项目中,我有一个名为proj的EnvDTE.Project对象.我尝试做((WixProjectNode)proj.Object),但它似乎没有提供任何有用的方法或属性.我还尝试像这样卸载,修改和加载项目:
aUIHierarchyItem.Select(vsUISelectionType.vsUISelectionTypeSelect);
dte.ExecuteCommand(``Project.UnloadProject'',string.Empty); 命令'Project.UnloadProject';不可用.
消息.那么,如何将导入添加到我的WiX项目中呢?作为最后的办法,我可以创建自己的WiX项目模板,但如果可能的话,我希望避免这种情况.

I'm writing a solution wizard inside which I add several projects. One of them is WiX project for which I need to add another import tag in project file. How do I do that? Inside my project I have an EnvDTE.Project object named proj. I tried to do ((WixProjectNode)proj.Object) but it doesn't seem to provide any useful methods or properties. I also tried unloading, modifying and loading project like that:
            aUIHierarchyItem.Select(vsUISelectionType.vsUISelectionTypeSelect);
            dte.ExecuteCommand("Project.UnloadProject", string.Empty);
but I only get:
            Command "Project.UnloadProject" is not available.
message. So how do I go about adding import to my WiX project? As a last resort I can create my own WiX project template but I would like to avoid that if at all possible.

推荐答案

命令"Project.UnloadProject"不可用. 表示未选择项目文件.在执行Project.UnloadProject之前,必须确保选择了正确的Node.
And Command "Project.UnloadProject" is not available. means that the project file are not selected. You must make sure that you have selected the right Node before you execute the Project.UnloadProject.


这篇关于将导入添加到项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:06