WCF, Service attribute value in the ServiceHost directive could not be found

后端 未结 22 1653
自闭症患者
自闭症患者 2020-12-04 17:19

I\'m trying to host my service with IIS 6 but I keep get this exception.

    Server Error in \'/WebServices\' Application.
----------------------------------         


        
22条回答
  •  悲哀的现实
    2020-12-04 18:05

    I had the same Exception, this is due to the Type not correctly mentioned in the .svc file

    I corrected with below fix.

    if your .svc.cs has class like this

    namespace Azh.Services.MyApp
    {
        public class WcfApp : FI.IWcfAppService
    {
    ...
    }
    }
    

    for this the .svc file should look like this

    <%@ ServiceHost Language="C#" Debug="true" Service="Azh.Services.MyApp.WcfApp" CodeBehind="WcfApp.svc.cs" %>
    

提交回复
热议问题