I building a simple utility to restore bak file into DB
1.IReferenced Microsoft.SqlServer.Smo.dll v10 and trying to create a Server object.
Compile error was: 'Microsoft.SqlServer.Management.Sdk.Sfc.ISfcPropertyProvider' is defined in an assembly that is not referenced. You must add a reference to
assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
2.Although MSDN indicates not to reference this dll I added a reference to this assembly and now Server is created
3.Now I am trying to create Restore object – but this type could not be found in the Microsoft.SqlServer.Management.Smo namespace
4.Referencing version 126.96.36.199 of Microsoft.SqlServer.Smo.dll (which was not in the VS2008 assembly list and could be referenced only by manually edit the project file) solved
all compilation errors
5.I am using a VS 2008 SP1 on a machine but the target framework of the project
is .NET Framework 2.0. No SQL server installed on the development machine.
6.After compiling I deployed it (simply copied the exe) to a machine with SQLexpress DB and .NET 2.0. Running the program caused an error: Could not load file or assembly 'Microsoft.SqlServer.SqlClrProvider,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.