从源代码编译 SubSonic 3.0.0.4

发布于 2024-11-26 05:43:35 字数 933 浏览 3 评论 0原文

我从 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's DbDataProvider.cs 第 56 行:

InterceptionStrategy = new DynamicProxyInterceptionStrategy(this);

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

谢谢
巴普

I downloaded SubSonic 3.0.0.4 sources from https://github.com/subsonic/SubSonic-3.0 and compiled it using Visual Studio 2010. When I add the compiled SubSonic.Core.dll to my own project and try to use the SimpleRepository like this

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

the dll crashes:

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

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

Crash occurs at SubSonic's DbDataProvider.cs on line 56:

InterceptionStrategy = new DynamicProxyInterceptionStrategy(this);

All works fine if I download ready-made SubSonic.Core.dll from the project's web site and use it. But I wanted to compile it myself, because I'll try to do some modifications on it later.

Thanks
Bapu

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无力看清 2024-12-03 05:43:35

我已成功从 Git 下载最新版本并在现有项目(具有 Microsoft SQL 数据库)中升级 Subsonic。我首先编译了 Subsonic.Core 项目,将旧的 dll 替换为新的,并出现了与您相同的错误。

内部异常表明它缺少对 Castle.Core 的引用。只需添加对 Caste.Core 的引用(在 /lib 文件夹中找到),您就可以开始了。

I've had success with downloading the latest revision from Git and upgrading Subsonic in an existing project (which has a Microsoft SQL database). I first compiled the Subsonic.Core project, swapped my old dll with the new and had the same error as you.

The inner exception states that it's missing a reference to Castle.Core. Just add a reference to Caste.Core with is found in the /lib folder and you should be good to go.

萌化 2024-12-03 05:43:35

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

Adding the Castle.Core.dll, solved the same issue for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文