Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference error with Fluent NHibernate 1.0 RTM and Visual Studio 2010 beta 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.

like image 678
Gimly Avatar asked Dec 09 '22 18:12

Gimly


1 Answers

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.

like image 158
David Bowers Avatar answered Apr 18 '23 17:04

David Bowers