0

I have three projects:

  1. TestNHibernateMappings - A console project
  2. WebApplicationPbiBoard - An Asp.Net MVC 3 Web project
  3. WebApplicationPbiBoard.Tests - An MsTest project

TestNHibernateMappings needs a reference to the PbiMap class located in WebApplicationPbiBoard.Models.ScrumModels_Mappings.

I've added WebApplicationPbiBoard as a project reference to TestNHibernateMappings, but Visual Studio keeps giving me namespace non-existence error when I try to include it. I've also tried removing and re-adding the reference, and performing a clean build of the entire solution both with no luck.

Any idea how to fix this? I've tried teaching my project about Descartes and disabling the Solipsist=true flag in the Console App, but those didn't work out either. Thanks in advance.

Here's the relevant code:

    MsSqlConnectionStringBuilder builder = new MsSqlConnectionStringBuilder();
    builder.Database("WebApplicationPbiBoard");
    builder.Server("local");
    builder.TrustedConnection();

    return Fluently.Configure()
        .Database(MsSqlConfiguration.MsSql2008.ConnectionString(builder.ToString()))
        .Mappings(m => m.FluentMappings.AddFromAssemblyOf<WebApplicationPbiBoard.Models.ScrumModels_Mappings.PbiMap>())
        .BuildSessionFactory();

The Fluently.Configure()... part is my attempt to configure a FluentNHibernate Session.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Vish
  • 453
  • 6
  • 18

1 Answers1

4

Check the target framework for TestNHibernateMappings and set it to .NET Framework 4.0. I suspect that you currently have it set to .NET Framework 4.0 Client Profile and that is the issue.

jason
  • 236,483
  • 35
  • 423
  • 525
  • Thanks. That solved the problem exactly. Do you have any insight as to why the Client Profile framework couldn't find the assembly? – Vish Aug 12 '11 at 23:48
  • @Vish: Because `TestNHibernateMappings` presumably relies on NHibernate and/or Fluent NHibernate which rely on components of the .NET Framework that are not in the .NET Framework Client Profile. – jason Aug 12 '11 at 23:50