ASP.NET
Problem with loading Dll dependencies
Gravatar is a globally recognized avatar based on your email address. Problem with loading Dll dependencies
  Numansen
  All
  Feb 21, 2018 @ 04:34am

I have been having this problem for over 3 weeks and have not been able to find a **good **sollution. I realy hope to get a fix for this problem i have had.

Here we go.

We have been using a dll of an ERP to get invoices that were not paid yet. The previous version was an old one and had a couple of bugs in it so we wanted to upgrade the system and use version 12 of the ERP program(and its dll).

The system we are currently using are 2 separate projects. A project(ASP.net Core) to open a service and make a localhost with higher level of access (because it needed admin level to launch the dll properly) so we could use the other project, an ASP.net framework project for navigating and such(buttons to get and set invoices of clients and send reminders via e-mail).

The system we want is ONE project with both the service and the client. There was one problem with having them both in one project. Every time we run the project and run the method to get the invoices an error shows up.

The error is: System.IO.FileNotFoundException: 'Could not load file or assembly 'filename, Version=12.48.37.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'

After decompiling the dll, we found out the AppDomain was using the wrong path and could not get the right files/dependencies of the Dll. We created a webforms App and tried the same methods to test it there and it worked. So for some reason the project we use to have de service and client in one Web application has some issues with finding the dependencies of the dll.

How can i fix it? and if you need more information i could give example codes.

PS sorry for my bad English and not worthy programming skills. Thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: Problem with loading Dll dependencies
  Rick Strahl
  Numansen
  Feb 21, 2018 @ 01:25pm

When you say it's getting the wrong dependency - where is it getting the wrong dependency from?

It sounds to me you have a multiple instances of the same DLL in multiple locations (including the GAC for full framework assemblies) and you need to make sure that your project only sees one of them.

+++ Rick ---

© 1996-2024