tags:

views:

307

answers:

2

I am using SubSonic 2.1 Final but having problems running "Version" with the SubCommander. I think this problem began when I installed SQL Server 2008 on my local machine and removed 2005.

This is the error I get:

ERROR: Trying to execute Version
Error Message: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.SmoEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.SqlServer.SmoEnum, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbCollation(String dbname)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetDbComparer(Boolean inServer)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.InitializeStringComparer()
   at Microsoft.SqlServer.Management.Smo.AbstractCollectionBase.get_StringComparer()
   at Microsoft.SqlServer.Management.Smo.SimpleObjectCollectionBase.InitInnerCollection()
   at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.get_InternalStorage()
   at Microsoft.SqlServer.Management.Smo.SmoCollectionBase.GetObjectByKey(ObjectKeyBase key)
   at Microsoft.SqlServer.Management.Smo.DatabaseCollection.get_Item(String name)
   at SubSonic.SubCommander.DBScripter.ScriptSchema(String connectionString) in C:\svn\subsonicproject\trunk\SubCommander\DBScripter.cs:line 51
   at SubSonic.SubCommander.Program.ScriptSchema() in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 696
   at SubSonic.SubCommander.Program.Main(String[] args) in C:\svn\subsonicproject\trunk\SubCommander\Program.cs:line 68

Anybody knows how to make this work?

+1  A: 

You probably have to compile SubCommander with the SqlServer 2008 version of Microsoft.SqlServer.Management.Smo dlls

Yitzchok
I wonder, if you recompile with SqlServer 2008 version of Management.Smo dlls, will your program (for instance, SubSonic) still work with SQL Server 2005?
Adam Nofsinger
A: 

I made this work by downloading the latest source and build it on my machine. Now it works great.

jesperlind