由于缺少依赖性,SubSonic“Version”失败

时间:2008-12-03 17:42:49

标签: subsonic

我正在使用SubSonic 2.1 Final,但在使用SubCommander运行“Version”时出现问题。我认为当我在本地计算机上安装SQL Server 2008并删除2005时,就会出现此问题。

这是我得到的错误:

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

有人知道如何使这项工作?

2 个答案:

答案 0 :(得分:1)

您可能必须使用SqlServer 2008版本的Microsoft.SqlServer.Management.Smo dll编译SubCommander

答案 1 :(得分:0)

我通过下载最新的源码并在我的机器上构建它来完成这项工作。现在它很棒。