This project has moved and is read-only. For the latest updates, please go here.

The component (unknown) cannot be created outside the HttpContext sharing boundary.

Jul 17, 2013 at 8:08 AM
I run into this exception this morning because I find out that when I update from old CodePlex code to Microsoft.Composition NuGet package the sharing policy changed and I didn't set the sharing right using the new ConventionBuilder.

The reason is happen is because I've set part A to be shared (singleton) and part A import in ctor part B and part B was HttpContext boundary shared.

Why did we get unknown in there? That made the debug a bit more difficult.

Nov 24, 2013 at 1:37 PM
Because my application is getting bigger and more developers we run into this issue more and it hard to debug by hand.
Any chance someone at Microsoft can explain why we have unknown instead of Type name or something like that?

Thank you,
Feb 28, 2014 at 10:37 AM
Edited Feb 28, 2014 at 10:38 AM
Had the same issue when using like this:
    [Shared("Session")] [Export]
    public sealed class SessionController : ApiController { ... }