How to create SimpleInjector.Container in other ApplicationDomain (WPF)

Dec 3, 2014 at 9:27 AM

I created BootStrap Class for my WPF project. That has got a public SimpleInjector.Container property.

When I want to create this class from other ApplicationDomain, that has given error about seriliazation.

How can i create Same class or SimpleInjector.Container in other ApplicationDomain ?

Any suggestion ?

Dec 3, 2014 at 9:32 AM
You can't and should not pass container instances from one AppDomain to another. Passing that from one to another means that the resolved services can be passed around. Create one container instance per AppDomain. If you need to have some specific data or behavior that need to be accessed by another AppDomain, create a specific abstraction for this, without touching the container directly.