Reputation: 85
So I made a C# project in visual studio with 3 class library projects. Everything works fine when debugging but When I try to deploy. Database and Program installs just fine but when I try to open the Application, I get an Assembly or File not Found Exception. The DLL he can't find is a class library in my project.
On the File System Editor, VS automatically detected the dependencies and included the 3 dll files in to application directory. I tried excluding these dll's and just adding the class library projects's primary output's (Same dll) but still the same error.
I used a Custom Installer class for creating my database on installation. But I don't think that is relevant.
Upvotes: 1
Views: 4943
Reputation: 6825
you need to include all dll's that are not part of the .net framework with your deployable. Your custom installer will copy these files to the location of the executable on install.
i usually create a folder called /deploy and copy all my needed dlls in there. I also change my projects settings to output to the /deploy-directory (instead of bin/). after you build, this directory will contain all dll's and other resources needed to run the application.
Upvotes: 1
Reputation: 28325
If you have verified that your 3 assemblies are indeed deployed to your destination folder, it could very well be an another dependency that you have not included in your setup project.
In worst case, run the SysInternals process monitor and that way figure out which assembly is missing.
Upvotes: 2