简体   繁体   中英

Assembly Not Found on deployment of C# project

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.

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.

  • Please double check that you indeed have the right number of assemblies included.
  • You can also right click the setup project and refresh dependencies.
  • Have you checked that dependencies in the setup project aren't excluded (by mistake)?
  • Furthermore, it may also be a .NET profile issue. Do you depend on assemblies that are only available in the full .NET profile, and your destination only has the client profile installed?

In worst case, run the SysInternals process monitor and that way figure out which assembly is missing.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM