unity-container

Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib

谁说胖子不能爱 提交于 2019-12-22 08:29:58
问题 I'm using Unity IoC (Microsoft.Practices.Unity) and I can compile fine, but I'm getting the following error at run time: Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The Unity version is: 3.0.1026.0 Is there a compatibility problem between .Net 4 and this version of Unity. Also, I get the same error when using Unity v2. If so, how might I go about resolving this issue? EDIT: Also, I

Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib

你说的曾经没有我的故事 提交于 2019-12-22 08:29:01
问题 I'm using Unity IoC (Microsoft.Practices.Unity) and I can compile fine, but I'm getting the following error at run time: Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The Unity version is: 3.0.1026.0 Is there a compatibility problem between .Net 4 and this version of Unity. Also, I get the same error when using Unity v2. If so, how might I go about resolving this issue? EDIT: Also, I

Child container registration based on route parameters

∥☆過路亽.° 提交于 2019-12-22 06:52:41
问题 We have a multi-tennant ASP.NET MVC application that hosts a booking engine for multiple clients. Each of these clients has multiple packages that can influence Unity Container configuration. We are creating a child container per request and registering different interface implementations based on the client and package parameters passed through the route. Currently we are accomplishing this by doing the following: Controller has a property ServiceLocator that uses a unity container to

The type IUserStore`1 does not have an accessible constructor

谁都会走 提交于 2019-12-22 06:52:19
问题 I want to setup MVC5 application with Unity 3. I created a default web mvc5 application from a standard template then add unity When I am accessing the Register action in AccountController I get the following exception: The type IUserStore`1 does not have an accessible constructor. from this post How to add MVC 5 authentication to Unity IoC? I know the problem is that Unity selects the constructor with longer parameter list. The solution is to register the Account controller to be used with

What is the advantage of UnityContainer.Resolve over Activator.CreateInstance?

折月煮酒 提交于 2019-12-22 05:53:08
问题 I'm just getting started with Unity. I am still wondering what its advantages are. UnityContainer().Resolve<T>() which can return a concrete instance of the type that is registered for the generic type T . I think I can also use Activator.CreateInstance<T>() . Activator is a built-in class in the .NET Framework, so I am wondering what the distinct feature for Unity is? 回答1: MSDN states these as the advantages of Unity Container: Simplified object creation, especially for hierarchical object

RabbitMQ with Unity IOC Container in .NET

馋奶兔 提交于 2019-12-22 04:11:03
问题 I am using Unity App Block as my IOC container for my service layer of a WCF project. This works quite well using the Unity.WCF library to plug it into each WCF service. I recently introduced RabbitMQ into my service layer and I am currently using the "using" blocks to connect and add to the queue. I dont like this though and am looking to use the HierachicalLifetimeManager to create and destroy my connection to RabbitMQ as I need them? Does this sound correct? I'm looking for a sample of

RabbitMQ with Unity IOC Container in .NET

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:10:53
问题 I am using Unity App Block as my IOC container for my service layer of a WCF project. This works quite well using the Unity.WCF library to plug it into each WCF service. I recently introduced RabbitMQ into my service layer and I am currently using the "using" blocks to connect and add to the queue. I dont like this though and am looking to use the HierachicalLifetimeManager to create and destroy my connection to RabbitMQ as I need them? Does this sound correct? I'm looking for a sample of

How to use ReactiveUI inside a PRISM module

烂漫一生 提交于 2019-12-22 00:27:51
问题 We have an existing WPF application that uses PRISM (6.x) with Unity (3.5.x) for DI. We are going to be adding more functionality to this application and would like to start utilizing ReactiveUI for any new modules that we need to implement. We were hoping to minimize the learning curve and continue to utilize Unity and DI for our ViewModels; however, ReactiveUI uses Splat for View location and so far I have not been able to get my ReactiveUI module to actually display in a PRISM region

Asp.net Identity, Generate WebApi token OAuthGrantResourceOwnerCredentialsContext - no access to UserManager using Unity

给你一囗甜甜゛ 提交于 2019-12-21 20:09:29
问题 I am trying to setup a project structure so that I have a WebApi, WebUI and Domain layer. I have moved all the Asp.Net.Identity objects into the Domain layer and have also setup the ApplicationContext here too (inheriting from IdentityContext). (I have used this tutorial and package as a base which is excellent. http://tech.trailmax.info/2014/09/aspnet-identity-and-ioc-container-registration/) In the WebAPI layer I am able to use the Account controller correctly to login and register. However

Unity 3 Configuration By Convention not finding Types in Web Project

人走茶凉 提交于 2019-12-21 18:06:22
问题 I am trying to get this convention configuration working but I am having a problem in my ASP.NET MVC5 Project.. I have added the following in my Application_Start method and hooked it up to DependencyResolver public static IUnityContainer CreateContainer() { IUnityContainer container = new UnityContainer(); container.RegisterTypes( AllClasses.FromAssembliesInBasePath(), WithMappings.FromAllInterfaces, WithName.Default, WithLifetime.ContainerControlled); return container; } But it fails to