Fluent NHibernate 1.0 RTM 和 Visual Studio 2010 beta 2 的参考错误
当我使用 Fluent NHibernate 1.0 RTM 和 Visual Studio 2010 beta 2 时,出现奇怪的参考错误。 基本上我已经尝试按照 Fluent NHibernate 页面上的入门教程进行操作,但它无法编译。我在 Visual Studio 上收到这两个参考错误:
警告 1 无法解析引用的程序集“FluentNHibernate”,因为它依赖于“System.Data.OracleClient,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”,而该依赖项不在当前目标框架中“.NETFramework,版本=v4.0,配置文件=客户端”。测试FluentNHibernate
警告 3 无法解析引用的程序集“FluentNHibernate”,因为它依赖于“System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”,该依赖项不在当前目标框架中。 NETFramework,版本=v4.0,配置文件=客户端”。测试FluentNHibernate
我不太明白为什么需要这两个程序集才能使用 FluentNHibernate,但我发现更奇怪的是它没有获取程序集。
顺便说一句,我创建了一个简单的控制台应用程序。
谢谢。
I have a weird reference error when I use Fluent NHibernate 1.0 RTM and Visual Studio 2010 beta 2.
Basically I have tried following the getting started tutorial on Fluent NHibernate's page and it doesn't compile. I get those two reference error on Visual Studio :
Warning 1 The referenced assembly "FluentNHibernate" could not be resolved because it has a dependency on "System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". TestFluentNHibernate
Warning 3 The referenced assembly "FluentNHibernate" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". TestFluentNHibernate
I don't really understand why those two assembly are needed to use FluentNHibernate, but I find it even weirder that it doesn't get the assemblies.
I have created a simple console application by the way.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,Visual C# 2010 的目标是“.Net Framework 4 Client Profile”,它是完整“.Net Framework 4”的子集,并且缺少这两个程序集。
转到项目菜单,然后选择菜单项 /Your Proj Name/ Properties... 在应用程序选项卡上更改目标框架:从 .NET Freamework 4 Client Profile 更改为 .NET Framework 4。
这是我使用任何 Visual 的第一个项目/anything/、NHibernate、Fluent 等,所以花了一段时间才弄清楚,谷歌无法在任何地方找到我的答案,所以希望这会有所帮助。
By default Visual C# 2010 targets the ".Net Framework 4 Client Profile" which is a subset of the full ".Net Framework 4" and is missing both of those assemblies.
Go to the Project Menu, and select menu item /Your Proj Name/ Properties... On the application tab change the Target framework: from .NET Freamework 4 Client Profile to .NET Framework 4.
This is my first project with any of Visual /anything/, NHibernate, Fluent etc so it took a while to figure out and Google couldn't find me answers anywhere, so hope this helps.
@David,
谢谢,你的评论是救星。
但奇怪的是,我的项目昨天运行良好,今天进行了重建,BAM,29 个错误都是因为没有找到 NHibernate / Fluent / 等引用。
更改您提到的设置有帮助。
@David,
Thanks, your comment was a lifesaver.
Weird though, My project ran fine yesterday, did a rebuild today and BAM, 29 errors all to doe with not finding the NHibernate / fluent / etc references.
Changing the settings you mentioned helped.