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 6637277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:17:37+00:00 2026-05-25T23:17:37+00:00

I have been looking into refactoring some old code into a new WCF service,

  • 0

I have been looking into refactoring some old code into a new WCF service, based on net 4.0 and have into a little difficulty with what should be a simple exercise!

The scenario;

WCF Service hosted over HTTP, implementing our ServiceContract, which connects to a local Sql Server.

When attempting to run a simple NUnit test against the Service Call, I get the following error;

* HelpManager.Tests.GetPage.GetPageById Fault
Exception:
System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]:
Activation error occured while trying to get instance of type
Database, key “HelpManagement” (Fault Detail is equal to An
ExceptionDetail, likely created by
IncludeExceptionDetailInFaults=true, whose value is:
Microsoft.Practices.ServiceLocation.ActivationException: Activation
error occured while trying to get instance of type Database, key
“HelpManagement” —->
Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the
dependency failed, type =
“Microsoft.Practices.EnterpriseLibrary.Data.Database”, name =
“HelpManagement”. Exception occurred while: while resolving. Exception
is: InvalidOperationException – The type Database cannot be
constructed. You must configure the container to supply this value.
———————————————– At the time of the
exception, the container was:

Resolving
Microsoft.Practices.EnterpriseLibrary.Data.Database,HelpManagement
—-> System.InvalidOperationException: The type Database cannot be
constructed. You must configure the container to supply this value.
at
Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.GuardTypeIsNonPrimiti…).

Our (pretty standard) WCF web.config for this, looks like;

<configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
</configSections>

<dataConfiguration defaultDatabase="HelpManagement"/>

<connectionStrings>
    <add name="HelpManagement" connectionString="server=(local);database=ieq;uid=;pwd=" providerName="System.Data.SqlClient"/>
</connectionStrings>

and an example of the code used to call it;

private const string DB_HelpManagement = "HelpManagement";
var db = DatabaseFactory.CreateDatabase(DB_HelpManagement);

Google et al have been no fun. I have checked versions etc and they all appear to be referencing the same 5.0.14 from GAC, so unsure as to what the problem is.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 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-25T23:17:38+00:00Added an answer on May 25, 2026 at 11:17 pm

    I wonder about Microsoft.Practices.ObjectBuilder.dll and Microsoft.Practices.EnterpriseLibrary.Common — are they referenced in the WCF project?

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

Sidebar

Related Questions

I have been looking into some existing code of the company I am with
I have been looking into IKVMing Apache's FOP project to use with our .NET
I have been looking into coloring objects like ellipses with code such as SolidBrush
I have just been looking into Linq with ASP.Net. It is very neat indeed.
I have been looking into the php fputcsv function, and have heard some comments
I have been looking into using Facebook Connect for a new web site I
I have been looking into the namespace for System.Net.PeerToPeer in .NET 4.0 and the
I have been looking into this for some hours now and can't figure it
I have been looking into android development for some time and would really like
I have an interesting problem which I've been looking into and would appreciate some

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.