Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6847069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:42:00+00:00 2026-05-27T00:42:00+00:00

I’ve heard that there are ways to take a C# app that uses HttpListener

  • 0

I’ve heard that there are ways to take a C# app that uses HttpListener and change it such that it will run in IIS but I’m unable to find any concrete references on this. Does anyone have any ideas on the topic that they could share?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:42:00+00:00Added an answer on May 27, 2026 at 12:42 am

    I found what I was looking for here: http://support.microsoft.com/kb/308001

    Looks like there are only minor code changes that would need to be implemented. Hope this can help someone else, too.

    Edit 6/21/19

    @Vermin asked if I could find the link, which I could not, but I did find a really old code base of mine with some embarassing code that may at least provide some starting points/directions (hopefully for others too). Please forgive me if I don’t provide good clarity on the ‘why’ behind some of these items (it was a while ago, and I didn’t understand it all to the depth I should have).

    1) The ServiceContract

    [ServiceContract] public interface <svcName> ... 
    {
            [OperationContract]
            [WebGet(UriTemplate = "/*", BodyStyle = WebMessageBodyStyle.Bare)]
            Stream MyGetMethod();
    
            [OperationContract]
            [WebInvoke(Method = "POST", UriTemplate = "/*", BodyStyle = WebMessageBodyStyle.Bare)]
            Stream MyPostMethod(Stream bodyStream);
    
    

    2) I also had to provide a content mapper (I can’t really remember why)

        public class RawContentTypeMapper : WebContentTypeMapper
        {
            public override WebContentFormat GetMessageFormatForContentType(string contentType)
            {
                return WebContentFormat.Raw;
            }
        }
    

    3) Then there was something I needed to do in web.config…

      <system.serviceModel>
        <services>
          <service name="<namespace>.<svcName>" behaviorConfiguration="<behaviorName>">
            <endpoint address="" binding="customBinding" behaviorConfiguration="<behaviorName>" contract="<namespace>.<svcName>" bindingConfiguration="<customBinding>"/>
          </service>
        </services>
        <bindings>
          <customBinding>
            <binding name="<customBinding>">
              <!-- Used for REST.  See http://www.codehosting.net/blog/BlogEngine/post/WebContentFormatRaw-in-your-WCF-config-file.aspx -->
              <!-- Provide the fully qualified name of the WebContentTypeMapper, set max message size to 500MB  -->
              <webMessageEncoding webContentTypeMapperType="<namespace>.RawContentTypeMapper, <namespace>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
              <httpTransport manualAddressing="true" maxReceivedMessageSize="524288000" transferMode="Buffered" />
            </binding>
          </customBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="<behaviorName>">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="<behaviorName>">
              <webHttp helpEnabled="true"/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <diagnostics performanceCounters="All"/>
      </system.serviceModel>
    

    I also saw this link in the comments of the project, which may prove useful: http://www.codehosting.net/blog/BlogEngine/post/WebContentFormatRaw-in-your-WCF-config-file

    You’ll have to forgive me if I can’t really explain the ‘why’ of all of the above. Some of it is easy to understand (mapping the GET, POST methods), some of it I felt like I was just trying things (the web.config stuff).

    For some context, I recall the app I was migrating had code to deal with all of the underlying HTTP connections and such, and once I migrated it to IIS using the above, it wasn’t that it was terribly fragile, I just felt as though I lost a lot of control without actually understanding the how or the why, and needing to make changes did cause me to feel it was fragile. It’s one of the reasons I built Watson Webserver (shameless plug) for quickly building RESTful servers: https://www.nuget.org/packages/Watson/2.0.5

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.