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

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

    Double check that you're referencing the correct type from the ServiceHost directive in the .svc file. Here's how...

    1. In the VS project containing your web service, open the .svc file in the XML editor (right-click the file, Open With..., choose XML (Text) Editor, OK).
    2. Note the "Service" attribute value.
    3. Make sure it matches the fully qualified type name of your service. This includes the namespace + type name. For example, if the namespace is "MyCompany.Department.Services" and the class is called "MyService", then the Service attribute value should be "MyCompany.Department.Services.MyService".
    0 讨论(0)
  • 2020-12-04 18:14

    This may sound trivial, but worth mentioning: You have to build the service (in Visual Studio) - then a DLL will be created in the bin subfolder.

    When the service is "deployed" on a server - that bin folder needs to have that DLL file in it - otherwise this error will be thrown...

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

    I had the same problem, found this thread, tried all but nogo.

    Then I spend another 4 hours wasted time.

    Then I found that the compilation settings had changed from 64bits to x86. When I changed it back to 64bits it worked. Don't know exactly why but could be that the IIS application pool was not set to allow 32 bit applications.

    0 讨论(0)
  • 2020-12-04 18:14
    1. Make sure markup (svc) file has service attribute with namespace.classname and codebehind will be classname.svc.cs

    2. Rebuild the solution

    3. Restart the app pools from local IIS once.

    0 讨论(0)
提交回复
热议问题