Could not load file or assembly 'Interop.ADOX

5k Views Asked by At

I am adding reference to Interop.ADOX.dll in my class library project "ABCD" in C#. When I built the project it builds fine. I can also access classes and functions provided by Interop.ADOX.dll. But when I run the exe which uses my dll "ABCD", it throw error : "Could not load file or assembly 'Interop.ADOX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

I tried creating a separate sample class library and adding reference to the Interop.ADOX.dll and that works fine. No errors. So there is nothing wrong with the Interop.ADOX.dll file.

Also I know somehow in my project structure it is not able to find the Interop.ADOX.dll file and hence unable to load it. So far I tried copying them at all the possible locations that I thought it might be trying to access it from but that did not work... Any suggestions that I can try out?


I found out something. In the project properties, Build Tab, when I chose platform target as any CPU then it throws error. But if I chose x86 it works fine. Why?

0

There are 0 best solutions below