简体   繁体   English

只有具有App.config的WCF服务部署到IIS

[英]Deploy WCF Service to IIS when it only has an App.config

I've add a project type of WCF Service Library to my project. 我已经为我的项目添加了一个项目类型的WCF服务库。 Doing this has allowed me to develop and test a WCF Service, however this service runs off an App.config and not Web.config. 这样做可以让我开发和测试WCF服务,但是这个服务运行的是App.config而不是Web.config。 In addition, it has no .SVC file like my prior projects. 此外,它没有像我以前的项目那样的.SVC文件。 What do I need to do in order to deploy this to IIS 6. 为了将其部署到IIS 6,我需要做什么。

Regards. 问候。

Basically four steps: 基本上有四个步骤:

  1. take the <system.serviceModel> part from your app.config and put it in web.config 从app.config中获取<system.serviceModel>部分并将其放在web.config中
  2. Add a virtual directory to IIS6 将虚拟目录添加到IIS6
  3. Add the service library's DLL to the ".\\bin" directory under that virtual directory 将服务库的DLL添加到该虚拟目录下的“。\\ bin”目录中
  4. Add an MyService.svc file to that directory which contains : MyService.svc文件添加到该目录,其中包含:

That's about all there is to it! 这就是它的全部内容!

Marc

If you're on Visual Studio 2008 SP1, there is actually a publish feature from the WCF Service Library template which you can use to publish to IIS. 如果您使用的是Visual Studio 2008 SP1,则实际上可以使用WCF服务库模板中的发布功能来发布到IIS。 It's available through the Build menu, or from the context menu when you right-mouse-click on the project from Solution Explorer. 当您从解决方案资源管理器中右键单击项目时,可以通过“生成”菜单或上下文菜单使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM