【问题标题】:Compiling SubSonic 3.0.0.4 from sources从源代码编译 SubSonic 3.0.0.4
【发布时间】:2011-07-26 11:36:08
【问题描述】:

我从https://github.com/subsonic/SubSonic-3.0 下载了 SubSonic 3.0.0.4 源并使用 Visual Studio 2010 对其进行编译。当我将编译后的 SubSonic.Core.dll 添加到我自己的项目中并尝试像这样使用 SimpleRepository 时

SimpleRepository repo = new SimpleRepository(ProviderFactory.GetProvider(connectionString, "System.Data.SqlClient"), SimpleRepositoryOptions.RunMigrations);

dll 崩溃:

An unhandled exception of type 'System.TypeInitializationException' occurred in SubSonic.Core.dll

Additional information: The type initializer for 'SubSonic.DataProviders.DynamicProxyInterceptionStrategy' threw an exception.

SubSonic 的 DbDataProvider.cs 第 56 行发生崩溃:

InterceptionStrategy = new DynamicProxyInterceptionStrategy(this);

如果我从项目的网站下载现成的 SubSonic.Core.dll 并使用它,一切正常。但我想自己编译它,因为我稍后会尝试对其进行一些修改。

谢谢
八浦

【问题讨论】:

    标签: subsonic subsonic3


    【解决方案1】:

    我已成功从 Git 下载最新版本并在现有项目(具有 Microsoft SQL 数据库)中升级 Subsonic。我首先编译了 Subsonic.Core 项目,用新的 dll 交换了我的旧 dll,并且遇到了和你一样的错误。

    内部异常表明它缺少对 Castle.Core 的引用。只需在 /lib 文件夹中添加对 Caste.Core 的引用即可。

    【讨论】:

      【解决方案2】:

      添加 Castle.Core.dll,为我解决了同样的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多