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

后端 未结 22 1569
自闭症患者
自闭症患者 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 17:59

    I had the same problem but no clue what caused it. I Solved it by changing from Debug to Release and Run using Debug/Start New Instance. After that, it ran in both Release and Debug. It was magic...

    0 讨论(0)
  • 2020-12-04 18:00

    In my case Right Click on Virtual Directory and Select "Convert To Application" worked!

    0 讨论(0)
  • 2020-12-04 18:03

    Building the solution before adding the service reference solved my problem.

    0 讨论(0)
  • 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" %>
    
    0 讨论(0)
  • 2020-12-04 18:05

    I got this error when trying to add the Service reference for the first Silverlight enabled WCF in the same solution. I just build the .Web project and it started working..

    0 讨论(0)
  • 2020-12-04 18:06

    Option One:

    This message is often due to an IIS 7 config problem. If you are used to creating a virtual directory pointing to the folder where your service resides, that no longer works. Now, you need to use the "Create Application..." option instead.

    Other Options:

    • WCF: The type provided as the Service attribute could not be found
    • The type , provided as the Service attribute value in the ServiceHost directive could not be found.
    0 讨论(0)
提交回复
热议问题