在VS 2012中构建时,WIX项目会出现奇怪的错误。 [英] Getting weird error for a WIX Project while building in VS 2012.

查看:99
本文介绍了在VS 2012中构建时,WIX项目会出现奇怪的错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2012中构建一个WIX项目时遇到了一个奇怪的错误。它在Visual Studio 2010中运行良好。



所以任何人都有想法为什么会抛出这种类型的错误?



错误2系统找不到文件'obj \Debug \pthFD364CC1E494D57F7AE3ED9DEF2DCD60 \ .. \ .. \..\..\..\..\src\services\c#\ReportProcessorWCFHost\bin\Debug\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design。 dll'与类型''。 light.exe 0 1 Proc





任何建议都会有所帮助。

I am getting a weird error while i build a WIX project in Visual Studio 2012. It is working fine with Visual Studio 2010.

So does anybody has any idea why it is throwing such type of error?

Error 2 The system cannot find the file 'obj\Debug\pthFD364CC1E494D57F7AE3ED9DEF2DCD60\..\..\..\..\..\..\src\services\c#\ReportProcessorWCFHost\bin\Debug\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.Configuration.Design.dll' with type ''. light.exe 0 1 Proc


Any suggestion will be helpful.

推荐答案

您显示的路径的命名表明您在构建项目的Debug配置期间尝试使用MSBuild创建的临时目录中的文件。你展示的是这种目录的默认命名方案。



你永远不应该做这些事情,你根本不应该使用那些临时的obj目录。这是对整个构建系统的滥用,而不仅仅是对WiX的滥用。您应该只使用项目输出目录中创建的项目工件。请注意,此目录也不应在WiX项目中进行硬编码。此目录在项目的相应属性中指定(您希望包含在设置中),并且应始终自动获取。即使您在创建WiX项目时更改输出目录的位置,它也将保持解决方案的完整性。



此外,您不应使用调试配置在您的安装项目中。我看不出任何用途。您需要使用Release。



请注意,WiX与MSBuild完美集成,并使用标准的MSBuild项目格式。此外,使用Visual Studio,您可以自动引用参与安装所需的项目。转到Solution explorer中的WiX项目树,然后添加引用。引用应该是项目引用,在添加引用窗口的项目选项卡中。



完成后,您可以引用引用的文件项目通过特殊属性,如 TargetPath 。例如:

The naming of the path you show suggests that you are trying to use the file from the temporary directory created by MSBuild during the build of your project for Debug configuration. What you show is the default naming schema for such directory.

You should never do such things, you should never use those temporary obj directories at all. This is the abuse to the whole build system, not just to WiX specifically. You should use only the project artifacts created in the project's output directory. Note that this directory also should not be hard-coded in the WiX project. This directory is prescribed in a corresponding property of the project (which you want to include in the setup) and should always be taken automatically. It will preserve the integrity of your solution even if you change the location of the output directories when the WiX project is already created.

Besides, you should not use Debug configuration in your setup project. I cannot see any use for it. You need to use Release.

Note that WiX is well integrated with MSBuild and uses the standard MSBuild project format. Also, with Visual Studio, you can automatically reference the projects you need to participate in installation. Go to the WiX project tree in Solution explorer, and add references. The references should be project references, in the tab "Projects" of the "Add Reference" window.

When this is done, you can reference the files in the referenced projects through the special properties such as TargetPath. For example:
<Component Id="Assemblies" Guid="... some guid ...">
    <File Source="


(var.Product .TargetPath) Id = entryPointAssembly / >
< 文件 来源 =
(var.Product.TargetPath)" Id="entryPointAssembly"/> <File Source="


(var.Library.TargetPath) Id = someLibraryAssembly / >
< / Component >
(var.Library.TargetPath)" Id="someLibraryAssembly"/> </Component>





在本例中,产品然后,Library就是项目的名称,例如,生成要安装的.NET程序集的C#项目,如Project.EXE和Library.DLL。这只是例如,它们可以是任何可以安装东西的项目。



你得到的照片吗?



-SA


这篇关于在VS 2012中构建时,WIX项目会出现奇怪的错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆