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

后端 未结 22 1566
自闭症患者
自闭症患者 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:52

    You should configure your bin folder path to service local bin.

    0 讨论(0)
  • 2020-12-04 17:54

    Add reference of service in your service or copy dll.

    0 讨论(0)
  • 2020-12-04 17:56

    If you have renamed anything verify the (Properties/) AssemblyInfo.cs is correct, as well as the header in the service file.

    ServiceName.svc

    <%@ ServiceHost Language="C#" Debug="true" Service="Company.Namespace.WcfApp" CodeBehind="WcfApp.svc.cs" %>
    

    Aligning with your namespace in your Service.svc.cs

    0 讨论(0)
  • 2020-12-04 17:57

    Two keys to this for certain flavors of the ' Service attribute value in the ServiceHost directive could not be found'-problem: (1) If you're working in Silverlight, you should use the Silverlight WCF-Enabled Service, not the non-Silverlight WCF Service; this will update Web.Config for the bindings and allow the type to be visible; (2) Match the class name in the new service to the Service name -- the goal here is to make a wsdl... so that you know the service's functionality is exposed to your Silverlight client and to the Web; it helps to have the service match the class. If you get the names gummed up, you will have to edit the Web.Config in 3 places (serviceBehaviors, services and bindings).

    There were so many sincere attempts to help folks with this problem that were not helpful to me that it should be stressed that this write-up is for a Silverlight solution and it may not apply for someone not using Silverlight 3 in a client/Web configuration.

    Hope it helps.

    0 讨论(0)
  • 2020-12-04 17:57

    I also ran into this issue trying the Microsoft.ServiceModel.Samples.Calculator WCF sample. I am using IIS 5.1. I resolved it by ensuring that the website that was auto-generated (servicemodelsamples) was not an application. Right-click the folder, click "Properties" and click the "Create" button.

    0 讨论(0)
  • 2020-12-04 17:59

    The problem could also be a in a different namespace in svc file as it is in svc.cs file.

    In svc file namespace must be in the following format.

    Service="Namespace.SvcClassName"
    
    0 讨论(0)
提交回复
热议问题