是否可以将温莎城堡与WCF服务一起使用

发布于 2025-01-05 01:57:53 字数 331 浏览 2 评论 0原文

是否可以将温莎城堡与 WCF 服务一起使用?

我尝试使用它,而不是使用参数转到承包商,我看到它转到默认承包商,我很好奇为什么要这样做?

protected void Application_Start(object sender, EventArgs e)
        {

            dm = new DependencyManager(HttpRuntime.AppDomainAppPath, "API");
            dm.Container.Install(new Installer());

        }

谢谢。

is it possible to use Castle Windsor with WCF services ?

I tried to use it and instead going to the contractor with parameters I see that it goes to the default contractor and I am curious why it is doing so ?

protected void Application_Start(object sender, EventArgs e)
        {

            dm = new DependencyManager(HttpRuntime.AppDomainAppPath, "API");
            dm.Container.Install(new Installer());

        }

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赴月观长安 2025-01-12 01:57:53

是的,你可以,但你的问题有点模糊。您是在尝试启动服务还是尝试注入客户端代理?您能举例说明您所做的事情吗?

编辑

要启动新的 wcf 服务,您需要使用 WcfFacility。您正在使用未显示的安装程序,因此您可能已经在其中连接了设备。

container.AddFacility<WcfFacility>()

注册完所有组件后,您可以使用 WCF 工具中包含的 DefaultServiceHostFactory 启动服务。

var host = (ServiceHost)new DefaultServiceHostFactory().CreateServiceHost(typeof(YourService).AssemblyQualifiedName, new Uri[] { });
host.Open();

Yes you can but your question is a little vague. Are you trying to start a service or are you trying to inject a client proxy? Can you show an example of what you have done?

EDIT

To start a new wcf service you will need to use the WcfFacility. You are using an installer which you don't show so you may already be wiiring up the facility in there.

container.AddFacility<WcfFacility>()

Once you have registered all your components you can start the service with the DefaultServiceHostFactory which is included in the WCF facility.

var host = (ServiceHost)new DefaultServiceHostFactory().CreateServiceHost(typeof(YourService).AssemblyQualifiedName, new Uri[] { });
host.Open();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文