Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi We were using an 32 bit application to restore database bak files programmatically. We used it in "32 bit windows 7 OS", having "sql server 2005" installed in it. And we faced no problems.
Now when we use the same application in "64 bit server 2012 r2 OS" and "sql server 2012 standard", the following exception is thrown:
"Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified".

Please help.
Posted
Updated 14-May-15 1:08am
v2
Comments
Afzaal Ahmad Zeeshan 14-May-15 8:07am    
Your project does not include the assembly... Make sure your project has the .dll file in the bin for this assembly.
John C Rayan 14-May-15 8:11am    
How do you reference the assembly from your application. You could either provide the assembly within the application in bin folder or make sure that the correct version is available in GAC. Check the version you are referencing.
virusstorm 14-May-15 12:03pm    
I've run into a similar issue. The easiest way to correct is right click on the reference in the project explorer, go to properties and make sure Copy Local is set to "Always".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900