compiling multiple projects into single exe

P

Patogenx

i am using visual studio 2005. i have a project and i want to use
HtmlAgilityPack. i use it in my solution by project reference however
its compiled into a dll but i want to compile it as a single exe.
so i try to combine projects by applying the following comment however
cannot be successful. the .netmodule file of the second file is not
linked into the .exe file but its just referenced as an external file,
so the exe does not work when the .netmodule file deleted.

do you have any suggestions to combine projects without using ILMerge.
i just want to know if its possible to do this without using ILMerge
because i want to understand compiling and linking tools better.
it seems to be possible with AL or within the visual studio by
MSBuild.
but how?
thanks in advance
~~~~~~~~~~~~
http://www.hanselman.com/blog/Mixin...ualStudioSeamlesslyWithILMergeAndMSBuild.aspx
Commetn by Jay R. Wren
This is a cute hack, but with the CSC and VBC both supporting the /
target:module and /addmodule options, you could actually do this
without ILMerge just by using a shell script or make file.

Visual Studio doesn't support the "netmodule" type, but MSBuild does.

Add the VB project to your solution. Unload the project and edit the
project file.

Change OutputType to module : <OutputType>module</OutputType>

Instead of adding a reference to the desired project, we add a module.
Sadly, again VStudio fails here, but MSBUILD works just fine. Unload
the project and edit the project file. Add an item group with
AddModules include directives.
<ItemGroup>
<AddModules Include="..\VbXml\bin\Debug\VbXml.netmodule" />
</ItemGroup>

This will tell msbuild to tell CSC to use /addmodule directives, just
like the Reference Item Group which Studio does manage.
~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top