In a .net application involving several projects in one solution, I have a project with the namespace set to Company.Product.UI and another one with Company.Product.UI.WebPages. My problem is that two dlls result from building the two projects. How can I have a single dll and still preserve the current solution structure. I use Visual Studio 2008 and C#.
It all depends on dependency-level of function add . If it is self contained function (like sorting), you can striaghtaway use in another project as suggest by Chad in point 2. If function has dependency (forms, classes other stuff), you may be in trouble. You may need to share all that into another project too.
Visual Studio allows you to specify how more than one project is run when you press F5 (Start with Debugging), or Ctrl+F5 (Start without debugging), or use the toolbar button to launch your application.
You will have to either merge the two projects into one project or use a tool like ILMerge to merge the resulting assemblies into a single assembly.
ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. It is freely available for use from the Tools & Utilities page at the Microsoft .NET Framework Developer Center.
If you want to automate ILMerge as an MSBuild task then I would suggest you take a look at ilmerge-tasks:
Interested in using ILMerge during an automated build? ILMerge Tasks containts two buildable projects that will allow you to access ILMerge as a task from both MSBuild and NAnt. It even includes a post-build event that merges ILMerge and the task dll so that you can use the task without ILMerge.exe being present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With