unity-container Questions
2
Solved
I know Unity can be configured to use a class' constructor to create an instance of a class (like below) but that's not what I want.
container.RegisterType<IAuthoringRepository, AuthoringReposi...
Zion asked 27/9, 2011 at 23:26
6
I am using the Unity.WebApi NuGet package (Unity 4.0.1 and Unity.WebApi 5.2.3) in an ASP.NET WebApi solution. The issue I am facing is that when attempting to run the code, I get the error: Make su...
Misconceive asked 21/1, 2016 at 23:56
1
Solved
I was using Unity DI Container v5.8.4 on my .NET Core 2.1 project and I needed to register Mediator object and I was using the configuration suggested here.
Now I have updated to v5.9.4 and I have...
Glia asked 13/2, 2019 at 7:44
4
Solved
I'm very new to using Unity, but my problem is that whenever I call my web service, I get an exception stating that
"Make sure that the controller has a parameterless public constructor"
I've fol...
Faris asked 13/4, 2015 at 17:8
6
Solved
Ultimately this has to do with setting up log4Net but generically the problem is not logging specific.
Generically what I am trying to figure out is how to do, in Microsoft Unity 2.0, something e...
Appreciate asked 27/7, 2011 at 14:46
0
I have a project that is written with c# on the top of ASP.NET MVC 5 framework. I set up an IoC using Unity-container to handle dependency injections.
I need to establish some kind of communicatio...
Combatant asked 17/10, 2018 at 21:41
2
Solved
I am struggling with this problem of dependency injection using untiy. I have implemented according to this link https://www.asp.net/web-api/overview/advanced/dependency-injection
But got this err...
Otic asked 6/1, 2017 at 5:45
4
Solved
Please help - I'm getting lost!
I'm writing a small desktop application which has some controls and some screen. This should later be integrated with a small web site, also having some screens. Th...
Sid asked 29/5, 2012 at 12:24
3
I think I'm missing something very simple and maybe just need a new set of eyes. I have an ASP.NET MVC application. In that app, I am using Unity for my IoC to handle dependency injection. Each of ...
Inexpungible asked 5/1, 2014 at 2:2
7
Solved
In my bootstrapper:
namespace Conduit.Mam.ClientServices.Common.Initizliaer
{
public static class Initializer
{
private static bool isInitialize;
private static readonly object LockObj = new o...
Erma asked 27/1, 2013 at 15:59
4
Solved
I have the IRespository registered twice (with names) in the following code:
// Setup the Client Repository
IOC.Container.RegisterType<ClientEntities>(new InjectionConstructor());
IOC.Contai...
Seriocomic asked 12/8, 2011 at 21:58
3
Solved
I'm using Unity's Register by convention mechanism in the following scenario:
public interface IInterface { }
public class Implementation : IInterface { }
Given Implementation class and its int...
Trumpery asked 20/1, 2016 at 17:22
6
Solved
I've been reading the articles on MSDN about Unity (Dependency Injection, Inversion of Control), but I think I need it explained in simple terms (or simple examples). I'm familiar with the MVPC pat...
Misquotation asked 3/3, 2009 at 22:54
2
Solved
More and more .NET Core libraries is bound to IServiceCollection. In example, I want to use HttpClientFactory described here in my NET Framework 4.7.1. desktop application. My application is using ...
Causeway asked 5/6, 2018 at 17:28
2
Solved
below is an example of production code that I am trying to unit test. I am struggling to resolve a dependency to a concrete class that is being used.
public MyClass(IUnityContainer container)
{
t...
Gagliano asked 9/9, 2015 at 15:51
4
Solved
I'm trying to figure out the correct way to inject an auto-factory which takes params, or even if this is possible with Unity.
For example I know I can do this:
public class TestLog
{
private F...
Colic asked 29/9, 2010 at 19:45
1
Solved
I am working on a project which uses a set of libraries from some other developer which uses structuremap as the IoC container. [I have the codebase with me]
The application in which we are incorp...
Appendicectomy asked 22/5, 2018 at 18:30
2
Solved
Update 09.08.2018
Unity is being developed here but I haven't had the time to test how it plays with the ASP.NET Core framework.
Update 15.03.2018
This solution is for the specific problem of using...
Clearcole asked 26/8, 2016 at 19:19
2
Solved
I have an app that is written using c# and ASP.NET MVC 5. I'm also using Unity.Mvc for dependency injection.
Along with many other classes, the class MessageManager is registered in the IoC contai...
Hadst asked 30/4, 2018 at 20:1
1
I have written asp.net core application and used below code for dependency injection, which is working fine as expected.
services.AddScoped<IDeviceRepository<Device>>(factory =&g...
Previous asked 26/4, 2018 at 13:6
2
Solved
In my Asp.net MVC project
I have a bootsrapper that initialize a unity-container.
I don't know why, but I get
An unhandled exception of type 'System.StackOverflowException' occurred in System...
Ansilme asked 28/1, 2013 at 11:40
1
Solved
I have ASP.NET MVC application. It was using .NET 4.5.1 with below Unity versions
<package id="Unity" version="4.0.1" targetFramework="net451" />
<package id="Unity.Mvc" version="4.0.1" t...
Trilogy asked 18/4, 2018 at 18:7
8
Solved
Can Unity automatically resolve IEnumerable<T>?
Let's say I have a class with this constructor:
public CoalescingParserSelector(IEnumerable<IParserBuilder> parserBuilders)
and I con...
Cuticle asked 25/12, 2009 at 17:26
5
Yesterday I've implemented the code:
CustomerProductManager productsManager = container.Resolve<CustomerProductManager>();
It was compilable and working.
Today (probably I've modified som...
Lugsail asked 20/5, 2010 at 15:46
4
I've written a class that has some dependencies it resolves from the unity container.
From my main class I create a new object
MyObject myObject = new MyObject();
I register it with my Unity Co...
Cretonne asked 5/2, 2010 at 7:24
© 2022 - 2024 — McMap. All rights reserved.