pha*_*oni 5 .net installer post-build-event visual-studio
我在项目中使用以下post构建操作,将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
Run Code Online (Sandbox Code Playgroud)
这很好用.现在我有一个安装程序项目并添加了项目输出.我希望使用"主要输出来源",即/ bin/Release中的exe.但实际上使用的是/bin/release/myApp.exe,而不是/obj/release/myApp.exe.
有谁知道我是否可以更改此行为并使用/ bin/release中的输出作为安装程序项目?谢谢.
似乎这个问题没有真正的解决方案,但存在解决方法。我在 Microsoft connect 上创建了票证:https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID =428898
微软的回答:
你好,
为了执行这些构建后操作,您需要将它们放入批处理文件中,然后添加适当的命令以在构建后事件对话框中调用批处理文件。我看到脚本中有多个实例引用了许多 Visual Studio 变量。由于我们不将这些变量公开为环境变量,因此您必须将它们作为参数传递给批处理文件。
我希望这有帮助!
Candy Jiang 项目经理 - Visual Studio