Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 385681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:30:13+00:00 2026-05-12T15:30:13+00:00

Background I have a BLL DLL that uses NHibernate. I share the same BLL

  • 0

Background

I have a BLL DLL that uses NHibernate. I share the same BLL between a client application and the WCF service (even though the client runs on another machine).

I can successfully use either SqlServerCe or SqlServer driver with the BLL with the client application but can only use the SqlServer driver for the WCF.

If I change the hibernate.cfg.xml to use SQL Server I am able to use the service as required with no exceptions being thrown.

The Error

The exact error from the log4net output is:

2421, 5, DEBUG, NHibernate.Connection.DriverConnectionProvider, (null),Obtaining IDbConnection from Driver 
2483, 5, DEBUG, NHibernate.Connection.DriverConnectionProvider, (null),Exception thrown obtaining connection: Exception has been thrown by the target of an invocation. 

I also have the following code in my WCF code behind file:

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);

NOTES

  • WCF bin directory contains all required DLL’s for NHibernate and SqlServerCe
  • Does not matter if System.Data.SqlServerCe.dll is in the GAC
  • Does not matter if System.Data.SqlServerCe.dll is added to the web.config file under assemblies
  • Operating Systems is Windows Server 2003 R2 SP2
  • .NET Framework 3.5SP1 installed
  • Visual Studio 2008 installed
  • Just incase, I uninstalled anything to do with compact edition but this still did not resolve the issue

The Question

How would you try and determine why NHibernate cannot load the SqlServerCe framework?

What forensic analysis would you perform to try and accurately determine the problem so that you can then find ways of resolving it?

Update 1

Incase it was my code I just created a simple website and am able to successfully use the ORM to insert and retrieve records using a hard-coded path to the SDF database. If I use the same hibernate configuration file for the webservice then exception is generated. This does narrow down the problem to the WCF implementation.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:30:13+00:00Added an answer on May 12, 2026 at 3:30 pm

    Well, clearing the ASP.NET temp cache did not do anything and deleting and republishing my site did nothing, but reverting to an VM Snapshot on the Windows 2003 R2 SP2 O/S did!

    An update or myself must have done something to the OS that caused the problems.

    I have a different problem now as the SQL is not successfully running under the environment but at least the NHibernate driver is loading and running to which this question was asking.

    Update: Yes, I can only get NHibernate talking to SQL Server still and this is fine for the webservice endpoint. We will investigate the issues at a later stage. Marking this answer as the correct one as no other comments have been added.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have an ASP.NET MVC application that wraps controller actions in a TransactionScope
Background We have a Windows .NET application used by our field employees who travel
Background I have a web app that will create an image from user input.
Background: I have a large 2D array of integers that I need to load
Background: I have a MVC2 project and am using jQuery 1.4.2. I have a
Background: I have 8 images for every sprite in my bird's view JavaScript game,
Background: I have a unit of optimised Delphi/BASM routines, mostly for heavy computations. Some
Background: I have a bird view's JavaScript game where the player controls a space
Background: I have a performance-critical query I'd like to run and I don't care
I'm working on this menu for a intranet system. I have a menu system

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.