The problem was my DLL library project was written in VB, but the main exe is in c#. So I converted the main exe to VB and everything runs fine.
Error 0x8007000B Could not load file or assembly ...or one of its dependencies. An attempt was made to load a program with an incorrect format.
I have a C# console program that has 2 projects, the main exe and a DLL. Both projects are loaded in VS when i get the error when I try to run as x64 not Any CPU, but I need to run as x64. Since the code for both projects is loaded in VS it should just compile and run as needed. I am at a loss here. Both projects reference the Microsoft.Data.SqlClient NuGit package and both are up to date with the current version.
2 answers
Sort by: Most helpful
-
-
ShaktiSingh-MSFT 16,271 Reputation points
2024-02-13T09:02:26.69+00:00 Hi Lee Taylor •,
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:
Solution in customer verbatim:
The problem was my DLL library project was written in VB, but the main exe is in c#. So I converted the main exe to VB and everything runs fine.
If you have any other questions or are still running into more issues, please let me know.
Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.