Click here to Skip to main content
15,884,019 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
I have two projects in the same solution. Project A needs to refer to Project B.

In Project A debug folder, there is a dll file generated from Project B.

Project A.exe runs fine if it is in the same fold as this dll file, but it will get an error massage, “Unhandled exception……Could not load file or assembly……”, if I move Project A.exe to another location without moving this dll file together.

Questions: is there a way to “embed” (I am not sure about this term) Project B dll file into Project A.exe, so I don’t need to keep them together all the time?

Thanks for your answer or hint:)
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jun-13 11:49am    
First of all, you should understand that EXEs and DLLs are not essential to .NET. There are modules and assemblies.
—SA
fishcosine 8-Jun-13 23:36pm    
Thank you both for the answers!!

 
Share this answer
 
Comments
CHill60 5-Jun-13 11:39am    
I like that! My +5
Thomas Daniels 5-Jun-13 11:42am    
Thank you!
Sergey Alexandrovich Kryukov 5-Jun-13 11:46am    
Right idea, a 5.
(I'm not sure if OP really needs it, but that's certainly a solution.)
—SA
Thomas Daniels 5-Jun-13 11:51am    
Thank you!
Instead of "moving" an exe around create a deployment package that contains all the dependent stuff you need (this might include config files and other resources for example).

Here's a starting point on deployment topics[^]
Another one to watch out for is on the properties for references like this ensure that Copy Local = True is set
 
Share this answer
 
Comments
Thomas Daniels 5-Jun-13 11:43am    
Deployment is a good idea, my 5!
CHill60 5-Jun-13 11:48am    
Thank you! Folks are going to think we're each other's sock puppet if we keep this up ;-p
Thomas Daniels 5-Jun-13 11:50am    
:laugh:
Sergey Alexandrovich Kryukov 5-Jun-13 11:48am    
Yes, the point is: maybe OP does not really need to merge the assemblies to have a single module. My 5 suggesting to consider the alternative.
The problem of merging can be resolved according to Solution 1.
—SA
fishcosine 8-Jun-13 23:37pm    
Thank you both for the answers!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900