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

Jul 17, 2013 at 7:08 AM
Hi,
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.

Ido.
Nov 24, 2013 at 12:37 PM
Hi,
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,
Ido.
Feb 28, 2014 at 9:37 AM
Edited Feb 28, 2014 at 9:38 AM
Hi,
Had the same issue when using like this:
    [Shared("Session")] [Export]
    public sealed class SessionController : ApiController { ... }
tnx