我找不到解决这个问题的办法:
我有接口:
public interface ITestService
{
...
}
然后,我有实现该接口的基类,并将其他服务作为属性:
public class BaseTestServiceImpl<T> : ITestService, IDisposable where T : class
{
protected T GenericProperty;
public IOtherService OtherService;
public void ExampleMethodFromBase()
{
问题:
我正在使用MVC4和WebAPI。我已经安装了Unity.WebAPI软件包,并且被卡住了。
我不知道需要在bootstrapper.cs、接口和类或我的控制器?的初始化()中注册什么
using System.Web.Http;
using Microsoft.Practices.Unity;
using unitywapi4.Models;
namespace unitywapi4
{
public static class Bootstrapper
{
public static void Initialise()
{
我有一个使用installutil成功安装的windows服务,但当我运行它时,我得到一个错误,说服务无法启动,因为它不能及时响应。在事件查看器中,我可以看到此错误。
Application: AuctionControl.Service.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.Practices.Unity.ResolutionFailedException
Stack:
我有一节课
public class Broker
{
public Broker(string[] hosts, string endPoint, string port, Type remoteType)
{
}
}
我想使用Unity XML Configuration来配置它,我可以使用C#中的代码来配置它,如下所示,其中" container“是我的Unity容器
container.Configure<InjectedMembers>()
.ConfigureInjectionFor