VB.NET app calling C++ dll, DLLNotFoundException

I have here C++ dlls that has been compiled as a 32bit dll.
It is called by .NET windows service, compiled as 32bit as well.
Provided below is a sample code to to use the methods of the C++dll

<DllImport("mytest.dll") , entrypoint:="mytestmethod1")>
public shared function mytestmethod1() as string
end function

This works in 32 bit.

My problem is this  - to make same code run in 64bit.
The C++ dll and the .NET windows service are now compiled as 64bit.
When i start to run the .NET windows service, I get an error as soon as I hit a code calling the C++ method -  a DllNotFoundException exception. so nonetheless, i added try catch statements for DllNotFoundException.

Im still getting this error but Im dead sure i have the c++ dll in the .NET windows service bin directory.

please help.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Give the 64 bit version a different name to the 32 bit version - modify your Dllimport code - does it still fail with the dllnotfoundexception?
jermineMAuthor Commented:
Recompiled the C++ to create using a new dll name. Copied the dll into the VB.NET bin folder.
Replaced the DLL name used  in the wrapper.
Still encountering DllNotFoundException.

any other ideas?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantCommented:
Nope - it was a long shot.
jermineMAuthor Commented:
thanks for the suggestion though :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.