从源代码编译 SubSonic 3.0.0.4
我从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已成功从 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.
添加 Castle.Core.dll 为我解决了同样的问题。
Adding the Castle.Core.dll, solved the same issue for me.