unity-container Questions

2

Solved

Is there a way on how to use interception by attribute in C# unity and keep the object registration code in XML file(like app.config)? If yes, can you provide me with code, how should such registra...
Calley asked 13/6, 2013 at 15:4

2

What is Unity InjectionConstructor Attribute and how it works ?
Hambley asked 19/1, 2009 at 17:48

2

Solved

We're using ASP.NET Identity 2.2 with ASP.NET MVC 5.2, Entity Framework 6.2 and Unity 5.7. We have a class, ConnectUserManager, that derives from ASP.NET Identity's UserManager. A newly constructe...

1

Solved

I have trouble to use Unity on this project. The error is The current type, Business.Interfaces.IPersonnelBusiness, is an interface and cannot be constructed. Are you missing a type mapping? ...

1

Solved

I want to know if there is a better to way to handle this. I've set up Unity for dependency injection for our project. The project itself is an ASP.NET application that uses Web API. I have the f...
Spenser asked 29/12, 2017 at 15:48

8

Solved

I just upgraded my ASP.NET MVC/WebApi project from Microsoft.Practices.Unity 3.5.1404 to 3.5.1406 (via nuget, just released). Afterwards, I'm getting this compile error: Error CS0012 The type 'I...
Realistic asked 30/9, 2015 at 20:39

0

I am trying to get work with dependency injection into the action filter, but it seems not working I've registered the type in UnityConfig public static void RegisterComponents(IUnityContainer ...
Southport asked 29/12, 2017 at 6:5

3

Solved

It is possible to register one type to multiple interfaces? I have class that implement two interfaces MyService : IService1, IServier2 {} I would like to register this type for both interfaces...
Posen asked 20/6, 2012 at 8:7

3

Solved

An hour ago I updated my nuget packages for the solution I'm working on and I get the error message, thrown by Unity, that The type 'IUnityContainer' is defined in an assembly that is not refe...
Monostylous asked 27/2, 2016 at 18:54

3

Solved

I have a base controller in my MVC 5 project which implements some shared functionality. This functionality requires some dependencies. I am using Unity 3 to inject these implementations into my co...

7

I am developing a Web Api and I decided to use custom DependencyResolver. I refer this [Dependency Injection for Web API Controllers] article. Everything is working well so far in the terms of depe...

2

Solved

I just downloaded Unity 3 to give it a try for my new project. The documentation states that this version allows Registration by Convention using the container.RegiserTypes method. But I cannot fin...

2

Solved

Right now I've got my validators hooked up and building in my app, but every time we add a new validator we need to manually go into our Unity configuration and register the type. I'd like to do th...
Pacifist asked 7/8, 2014 at 14:35

3

I have one interface: IFoo Two classes implementing that interface: FooOne and FooTwo And two classes ClassOne and ClassTwo receiving an IFoo parameter in the constructor. How I configure unity s...
Anonym asked 29/10, 2012 at 22:33

1

I am creating a Web Api in C#.Net. I have implemented Dependency Injection in it using Unity.Mvc5 and using Db First approach. Since then i'm facing some issues in connection strings. There is a de...
Belshazzar asked 2/11, 2017 at 10:17

3

Solved

I am working on a middle sized WPF application (MVVM) that should be extensible and maintainable in the future. Thus I decided to use an IoC container (Unity in this case) to keep things flexible. ...

5

Solved

I am attempting to use the following Generic Repository Interface for DI and constructor injection: public interface IRepository<TEntity> : IDisposable where TEntity : class The problem is...
Ambitious asked 16/1, 2013 at 18:54

2

Solved

I have looked at several tutorials and stackoverflow questions on how to implement unity for an MVC 5 project, but I can't seem to get past this error : The type String cannot be constructed. Yo...

1

Solved

When I am trying to invoke Accounts controller, I am getting this error back, [InvalidOperationException: The current type, Microsoft.AspNet.Identity.IUserStore`1[Proj1.Web.Models.ApplicationUse...

2

Solved

We have an external project with a QCServiceLog class that has a ILogging dependency which is resolved by Unity. But QCServiceLog is a Singleton class as you can see in the following example: priva...
Doublet asked 22/2, 2017 at 18:5

1

Solved

I get the following error when visiting my SPA site which makes some calls to the API when loaded: A second operation started on this context before a previous asynchronous operation completed....
Bihari asked 17/7, 2017 at 13:52

3

Solved

I am trying to locate PerRequestLifetimeManager. In MSDN, it says that it is part of the Unity 3 assembly. I've installed Unity.Mvc4 via Nuget. The package.config says I am using Unity 3.0: Th...
Armoured asked 25/12, 2013 at 1:49

3

Solved

I have a problem when adding new values with a many to many mapping in Entity Framework. I know about the unit of work pattern but in our solution we would like to keep a simple repository pattern ...
Robinett asked 11/7, 2017 at 9:10

11

Solved

Has anyone had any success running using an IoC container to inject dependencies into ASP.NET WebAPI controllers? I cannot seem to get it to work. This is what I'm doing now. In my global.ascx.c...
Lehr asked 2/3, 2012 at 4:29

2

Solved

In Unity, as I know I can use the following 2 options to register a singleton instance: IConfiguration globalConfig = new Configuration(); container.RegisterInstance<IConfiguration>(global...
Enlil asked 31/5, 2017 at 18:28

© 2022 - 2024 — McMap. All rights reserved.