views:

728

answers:

2

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.

+12  A: 

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 Bowers
Great! Thank you, I didn't know about this "Client Profile".For more information about what Client Profile is :http://blogs.msdn.com/jgoldb/archive/2009/05/27/net-framework-4-client-profile-introduction.aspx
Gimly
I just ran into this issue. Thanks for clearing this up! A better error message would be nice from Microsoft.
Andy
+10 if I could. Thanks a ton for getting me out of that bind!
Todd Menier
A: 

@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.

Neville