我正在在项目中使用以下帖子构建操作,将LIB合并到我的应用程序中:

IF $(ConfigurationName) == Debug GOTO end
cp $(TargetPath) $(TargetDir)app_unmerged.exe
del $(TargetPath)
"C:\Program Files\Microsoft\ILMerge\ilmerge.exe" /internalize $(TargetDir)MyApp_unmerged.exe $(TargetDir)someLib.dll /out:$(TargetDir)myApp.exe
del $(TargetDir)myApp_unmerged.exe $(TargetDir)someLib.dll
:end

这很好。现在,我有一个安装程序项目并添加了项目输出。我希望使用“主要输出”,即exe in /bin /preama。但是实际上使用了/bin/release/myapp.exe,/obj/release/myapp.exe。

有谁知道我是否可以更改此行为并为安装程序项目使用 /bin /preama in in bin /preamity?谢谢。

有帮助吗?

解决方案 3

似乎没有解决这个问题的真正解决方案,但是存在解决方法。我在Microsoft Connect上创建了一张票: https://connect.microsoft.com/visualstudio/feedback/viewfeedback.aspx?feedbackid=428898

Microsofts anwser:

你好,

为了执行这些后构建操作,您需要将它们放入批处理文件中,然后添加适当的命令以在“邮政构建事件”对话框中调用批处理文件。我看到脚本中有几个实例,引用了许多Visual Studio变量。由于我们不将这些变量视为环境变量,因此您必须将它们作为参数传递给批处理文件。

我希望有帮助!

Candy Chiang计划经理 - Visual Studio

其他提示

我解决了该问题应用于 /OBJ文件夹,这是我的后构建事件配置:

复制$(projectDir)obj $(platformName) $(configurationName) $(targetFileName)$(targetDir)temp.exe $(solutiondir) lib lib ilmerge /wildcards /t:exe /t:exe /out: obj $(platformName) $(configurationName) $(targetFileName)“” $(targetDir)temp.exe“” $(targetDir)log4net.dll' 。可执行程序

我明确地将文件放置,这意味着它没有告诉设置项目使用Primery Content,而是明确地将.EXE/.DLL文件放置。
这很好,我可以控制将输入哪个文件和设置项目用户相对路径,因此可以在其他计算机上使用设置项目。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top