TypeInitializationexception -filenotfoundexception

144 Views Asked by At

I seem to be having odd issues with one of my assemblies, So my program was working fine in Net4.6.1, but i had to upgrade to 4.6.2 as this is the new target framework. Also the references went to a new location from program files x86 to program files.

However doing this gave me an typeinitializationexception, when debugging a little further we seem to come across a filenotfoundexception of one of my dependencies log4net.

all de dll are added trough references-add reference ->external location

by some miracle i had made it back to work in debug mode but not in release mode.

AS i discovered in release mode same issue, so I tried to put my dlls in root folder where the exe is an not my dependencies folder and it seems to work. SO my guess is that even tough i specified a url trough adding the references it keeps searching in the root directory of the exe.

Any idea why and how i can fix this kind of problem?

The only solution i have tried is by creating a new project and copy my code in it-> same issue. The reason why we put all our dependencies in a seperate folder is to prevent version mismatch.? and in this project we have several dll's that are used with multiple version old ones for the main program and new ones for this project which are added to gac.

0

There are 0 best solutions below