我一直在尝试按照本教程将WCF示例部署到IIS.我无法让它发挥作用.这是一个托管站点,但我确实有IIS管理员访问服务器.但是,在本教程的第2步中,我无法"创建一个物理上位于此应用程序目录中的新IIS应用程序".我似乎无法找到菜单项,上下文菜单项或什么不创建新的应用程序.我一直在疯狂地点击所有地方,仍然无法弄清楚如何创建一个新的应用程序.我想这可能是根本问题,但我尝试了其他一些事情(如下所述)以防万一实际上不是问题.这是我在IIS管理器中看到的图片,以防我的话不公正:
没有添加应用程序在这里http://www.freeimagehosting.net/uploads/d6edbaaf3c.png
这是在http://test.com.cws1.my-hosting-panel.com/IISHostedCalcService/Service.svc上 "部署"的.错误说:
The type 'Microsoft.ServiceModel.Samples.CalculatorService',
provided as the Service attribute value in the ServiceHost directive,
or provided in the configuration element
system.serviceModel/serviceHostingEnvironment/serviceActivations
could not be found.
Run Code Online (Sandbox Code Playgroud)
我还尝试在dotnetpanel中创建一个指向IISHostedCalcService的虚拟目录(IISHostedCalc).当我导航到http://test.com.cws1.my-hosting-panel.com/IISHostedCalc/Service.svc时,会出现另一个错误:
This collection already contains an address with scheme http.
There can be at most one address per scheme in this collection.
Run Code Online (Sandbox Code Playgroud)
有趣的是,如果我点击查看应用程序,似乎虚拟目录是一个应用程序(见下图)...虽然,根据上面的错误消息,它不起作用.
这是一个应用程序?http://www.freeimagehosting.net/uploads/f3230be046.png
根据教程,没有涉及编译; 我刚刚将文件放在服务器上,如下面的文件夹IISHostedCalcService:
service.svc
Web.config
<dir: App_Code>
Service.cs
Run Code Online (Sandbox Code Playgroud)
service.svc包含:
<%@ServiceHost language=c# Debug="true" Service="Microsoft.ServiceModel.Samples.CalculatorService"%>
Run Code Online (Sandbox Code Playgroud)
(我尝试使用c#属性的引号,因为这看起来有点奇怪没有引号,但它没有区别)
Web.config包含:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="Microsoft.ServiceModel.Samples.CalculatorService"> …
Run Code Online (Sandbox Code Playgroud)