0

I have created two projects in one solution and the idea is that I want to have one project call a method in the other project. I have added the called project as a reference to the calling project, but when I try to run the code I get this error:

Additional information: Could not load file or assembly 'abc, Version=9.8.0.0, Culture=neutral, PublicKeyToken=4f047e93159395ca' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

When I paste the main method that is calling the method from the other project into the called project and only run that one it works fine. So it is likely not a problem with dependencies.

Allen Huang
  • 394
  • 2
  • 14

1 Answers1

0

Follow the steps bellow using adapting them to your needs.

  1. In your Main project (the one you defined as startup project) right click on References > Add Reference > Projects and select the dependency. enter image description here

  2. Declare the dependency project with using and call the method from the other project in your main program. enter image description here

  3. Compile your solution, and check if the .dll of your dependency is in the same bin folder of your main application. enter image description here

bmvr
  • 817
  • 2
  • 9
  • 25