" in the Installer Project I use the following steps to create an assembly in a p...">

VS.Net: Post Build Events for "Primary Output from <myProject>" in the Installer Project

I use the following steps to create an assembly in a project to integrate lib into my application:

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

It works great. Now I have an installer project and project output has been added. I would expect that "Primary output from" is used, that is, exe in / bin / Release. But in fact, instead of /bin/release/myApp.exe, / obj / release / myApp.exe is used.

Does anyone know if I can change this behavior and use the output in / bin / release for the installer project? Thank you

+5
source share
3 answers

, , . Microsoft connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=428898

Microsofts anwser:

,

, , . , script Visual Studio. , .

, !

- Visual Studio

+1

, Ilmerge /obj, :

COPY $(ProjectDir) obj\$(_)\$(_)\$(TargetFileName) $(TargetDir) temp.exe $ (solutionDir)\lib\ilmerge/wildcards/t: exe/out: "$ (ProjectDir) obj\$(PlatformName)\$(ConfigurationName)\$(TargetFileName)" "$ (TargetDir) temp.exe" "$ (TargetDir) log4net.dll" "$(TargetDir) other.dll" DEL $(TargetDir) temp.exe

+2

I put the files explicitly, which means that instead of telling the installation project to use the contents of primery, it explicitly places the .exe / .dll file.
This works very well, I can control which file will be entered and the relative paths of the user of the project project so that the installation project can be used on other machines.

+1
source

All Articles