WCF .SVC Debug=”true” ignored when when release compiling?

By default a .SVC file contains Debug=”true”, I was wondering if this is ignored if you compile for release or is it still compiled with debug symbols?

Ex.

<%@ ServiceHost Language="C#" Debug="true" Service="WebPages.Interfaces.example" CodeBehind="example.svc.cs" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Debug=true attribute in @ServiceHost directive only apply, if you are writing your service as inline code in .svc file, or implementing service in “App_Code” folder. (It won’t apply if already compiled into assembly and placed it into bin directory.)

Method 2

Publishing a WCF service on IIS 8

I had this problem and i found this as the solution.
This worked for me perfectly (IIS 8)

All the credits goes to György Balássy

WCF services don’t run on IIS 8 with the default conჁguration, because the webserver doesn’t know, how to handle
incoming requests targeting .svc Ⴡles. You can teach it in two steps:

  1. Add a new MIME type:
    Extension: .svc
    MIME type: application/octet-stream
    Add a new MIME type
  2. Add a new Managed HTTP Handler:
    Request path: *.svc
    Type: System.ServiceModel.Activation.HttpHandler
    Name: svc-Integrated
    Add a new Managed HTTP Handler

That’s it!


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x