0

My main project was referred to mainreference.dll. The mainreferenced.dll was referred to AA.dll, BB.dll & CC.dll. I made some changes to BB.dll and rebuild the mainreference.dll and added it back to main project.

The code is build-ed without any error, while running I am getting an error

System.IO.FileNotFoundException: Could not load file or assembly 'XXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'XXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

The main project is seeking for separate reference to AA.dll, BB.dll & CC.dll which was referred inside mainreference.dll.

How can I fix this issue?

Suressh
  • 15
  • 7
  • I know that is stupid but... are these dlls present in your output directory? – Adam Jachocki Jan 21 '19 at 10:05
  • do you use AA.dll, BB.dll and CC.dll in your mainproject as well? – DanDan Jan 21 '19 at 10:06
  • 2
    First make sure the AA,BB,CC assemblies/DLLs are really in the release/debug build output directory of the (main) project you attempt to run. If they are, make sure that they are the correct version. Note that based on the error message, your program looks specifically for version 1.0.0.0 of the DLL/assembly XXXX –  Jan 21 '19 at 10:13
  • 3
    To debug these kind of problems, [Fusion log](https://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net) is your friend. – Klaus Gütter Jan 21 '19 at 10:16
  • @DanDan am not directly using in main project but they are used inside mainreference.dll – Suressh Jan 21 '19 at 10:26
  • @elgonzo I dont want to refer them again in main project because which are already refered inside another dll and added into it. This was working before i edited BB assembly – Suressh Jan 21 '19 at 10:27
  • @Suressh, i don't understand your response to my comment. I never mentioned/suggested to let your main project refer to these assemblies. Please read my comment again... –  Jan 21 '19 at 10:28
  • @elgonzo Sorry, Mistake was mine. Thanks it is working. But I didn't understand, without adding those dlls it worked fine before. – Suressh Jan 21 '19 at 10:38
  • @elgonzo The installed application also expect the dll's in the installation directory. is there any way to avoid them and include/ refer only mainreference.dll in the main program, without exposing other AA, BB.. to the main program? – Suressh Jan 21 '19 at 11:25
  • I don't know what you mean when saying "_without exposing other AA,BB,... to the main program_". Since your program depends on those DLLs (your main project depends on mainreference.dll which in turn depends on AA,BB, etc...) it needs to be able to load those DLLs at runtime somehow from some location/path it knows about (generally speaking). –  Jan 21 '19 at 19:23

0 Answers0