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

  • Home
  • SEARCH
  • 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 489895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:51:16+00:00 2026-05-13T01:51:16+00:00

I ‘m using PRISM and in the Bootstrapper class i did override the ConfigureContainer()

  • 0

I ‘m using PRISM and in the Bootstrapper class i did override the ConfigureContainer() method. There is nothing fancy in it just these lines:

protected override void ConfigureContainer()
{       
    Container.RegisterType<IDataContext, SQLDataContext>(new InjectionConstructor(@"Server=localhost\SQLExpress;User Id=sa;Password=xxxxx;Database=MyDatabase"));
        base.ConfigureContainer();
}

At “debug-time” i try to call Container.Resolve() but this gives me the following error:

{“Resolution of the dependency failed, type = \”Photo.DAL.Abstract.IDataContext\”, name = \”\”. Exception message is: The current build operation (build key Build Key[Photo.DAL.Concrete.SQLDataContext, null]) failed: Value cannot be null.\r\nParameter name: stream (Strategy type BuildPlanStrategy, index 3)”} System.Exception {Microsoft.Practices.Unity.ResolutionFailedException}

But when i do

Container.IsTypeRegistered(typeof(IDataContext))

I get true!!!

  • What am I missing???

Info which published as answer below, which should be an edit to the question:

This is the full stack:

Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Photo.DAL.Abstract.IDataContext", name = "". Exception message is: The current build operation (build key Build Key[Photo.DAL.Concrete.SQLDataContext, null]) failed: Value cannot be null.
Parameter name: stream (Strategy type BuildPlanStrategy, index 3) ---> Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Photo.DAL.Concrete.SQLDataContext, null]) failed: Value cannot be null.
Parameter name: stream (Strategy type BuildPlanStrategy, index 3) ---> System.ArgumentNullException: Value cannot be null.
Parameter name: stream
   at System.Data.Linq.Mapping.XmlMappingSource.FromStream(Stream stream)
   at Photo.DAL.Mapping.GetMapping() in C:\Users\Savvas\Documents\Visual Studio 2008\Projects\Photo\Photo.DAL\Mapping.cs:line 18
   at Photo.DAL.Concrete.SQLDataContext..ctor(String connectionString) in C:\Users\Savvas\Documents\Visual Studio 2008\Projects\Photo\Photo.DAL\Concrete\SQLDataContext.cs:line 52
   at BuildUp_Photo.DAL.Concrete.SQLDataContext(IBuilderContext )
   at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
   at Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator locator, ILifetimeContainer lifetime, IPolicyList policies, IStrategyChain strategies, Object buildKey, Object existing)
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name)
   --- End of inner exception stack trace ---
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name)
   at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name)
   at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name)
   at Microsoft.Practices.Unity.UnityContainerBase.Resolve(Type t)
   at Microsoft.Practices.Unity.UnityContainerBase.Resolve[T]()
   at Photo.Desktop.Bootstrapper.ConfigureContainer() in C:\Users\Savvas\Documents\Visual Studio 2008\Projects\Photo\Photo.Desktop\Bootstrapper.cs:line 42

I noticed that the error is not coming from actually resolving the class, but from the calling method GetMapping() which is defined as

public static class Mapping
    {
        public static XmlMappingSource GetMapping()
        {
            XmlMappingSource mapping;
            using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Photo.DAL.Entities.Entities.map"))
            {
                mapping = XmlMappingSource.FromStream(stream);
            }
            return mapping;
        }
    }
  • Is Unity incapable of doing this? (it worked well with Windsor!!)
  • 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-13T01:51:16+00:00Added an answer on May 13, 2026 at 1:51 am

    It could be one of two things.. it’s not clear from your exception exactly…

    1. Likely there is another inner
      exception that might be masked?

    2. Otherwise it might be that your
      SqlDataContext class has a
      constructor that accepts a stream?

    Again, the exception isn’t quite clear enough (at least to me). If neither of these suggestions helps, could you post the full out put of $exception.ToString() in your question?

    Edit: according to your full stack trace, the line of code failing is this one:

    using (Stream stream = Assembly.
                           GetExecutingAssembly().
                           GetManifestResourceStream("Photo.DAL.Entities.Entities.map"))
    {
        //This line is failing with null argument
        mapping = XmlMappingSource.FromStream(stream);
    }
    

    Your resource stream is coming back null, which either indicates your resource does not exist or the assembly couldn’t be loaded (sometimes this refers to a satellite assembly). I would suspect the former first… check to make sure the Build setting is correct on your .map file.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I'm creating a web service to transfer json to an iPhone app. I'm using
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I've got a string that has curly quotes in it. I'd like to replace
i got an object with contents of html markup in it, for example: string
I am currently running into a problem where an element is coming back from
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a JSP page retrieving data and when single or double quotes are
The problem with unsigned char. I am reading a PPM image file which has

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.