发布WCFService不起作用;调试模式 [英] Publish a WCFService doesn't work; Debugging-mode works

查看:42
本文介绍了发布WCFService不起作用;调试模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想启动一个默认的webservice-project,可以在其中通过服务发送数据.当我通过VS调试API时,一切正常,但是当我尝试通过IIS使用它时却无法正常工作.

I want to start an default webservice-project, where I can send data over a service. When I go to debug the API through VS then everything works fine, but not when I try to use it over IIS.

我在Visual Studio 2017中创建了一个WcfServiceLibrary-Project.然后我右键单击该项目(在解决方案资源管理器中),然后将其发布到文件夹A中.

I created an WcfServiceLibrary-Project in Visual Studio 2017. I then right-clicked on the project (in the solution explorer) and then published it to a folder A.

我在IIS上也没有做任何特别的事情(所有内容仍在localhost上):我激活了默认的Windows功能"IIS".(默认网站也已停止).然后,我在其中添加了一个带有随机名称的站点以及文件夹A的路径.服务已启动.

I also didn't do anything special at IIS (all the things are still on localhost.): I activated the default windows-feature "IIS". (The default web site got also stopped). Then I added there a site with an random name and the path to the folder A. The service got started.

我的访问试用是通过Visual Studios连接的服务"找到任何东西.

My access trial was to find anything through Visual Studios "connected services".

有人有主意吗?

推荐答案

首先,请使用WCF服务应用程序项目模板,

否则,将不会启动Appconfig文件.库项目需要在托管环境中进行其他配置,并且无法识别Appconfig文件.我们必须将配置代码移到您的托管环境可以识别的配置文件中.

随时让我知道问题是否仍然存在.

At first, please use the WCF service application project template,

or the Appconfig file would not be kicked in. library project needs the additional configuration in the hosting environment, and the Appconfig file could not recognized. We have to move the configuration code into the configuration file recognized by your hosting environment.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/deploying-a-wcf-library-project
Secondly, for hosting the WCF service in IIS, we should enable the below windows feature.
Feel free to let me know if the problem still exists.

这篇关于发布WCFService不起作用;调试模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆