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 6078461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:50:11+00:00 2026-05-23T10:50:11+00:00

I am learning WCF. I have an ASP.NET MVC2 web app, and I want

  • 0

I am learning WCF. I have an ASP.NET MVC2 web app, and I want to send mime-formatted emails from the app so I thought I’d encapsulate the email functionality in a separate WCF project for future reuse etc. I therefore added a WCF Service Library to the solution, coded the email functionality, added a Service Reference to the web project, and it all works fine when run from within VS. However, if I access the web app from a browser window (and not via Visual Studio ‘F5’), then the WCF service does not work. I get the following error:

Unable to connect to the remote server
at
System.Net.HttpWebRequest.GetRequestStream(TransportContext&
context) at
System.Net.HttpWebRequest.GetRequestStream()
at
System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
No connection could be made because
the target machine actively refused it
127.0.0.1:8732 at System.Net.Sockets.Socket.DoConnect

The web.config file in the web app was amended (by WCF) as follows:

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IEmailService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
          maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
          textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
            enabled="false" />
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
              algorithmSuite="Default" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8732/Design_Time_Addresses/Email/EmailService/"
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IEmailService"
        contract="EmailServiceReference.IEmailService" name="WSHttpBinding_IEmailService">
        <identity>
          <dns value="localhost" />
        </identity>
      </endpoint>
    </client>
  </system.serviceModel>

What do I need to do to get the app+service to work outside of VS2010? Also, any deployments tips would be greatly appreciated for when I eventually deploy to our servers.

Thanks.

Edit
Thanks for all the answers. Given that I am going to deploy this on the web, should I create a separate web app or web service which then references the service library, and which i would then deploy to an independent web server in due course?

  • 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-23T10:50:11+00:00Added an answer on May 23, 2026 at 10:50 am

    The reason is when u run with F5 your wcf service get automatically hosted WcfSvcHost.exe . But when directly access the web page thru localhost (without havign wcf service hosted) you get this error. What you need to do is host the wcf first in IIS ( or anywhere else) and then use the web app.

    Here are options for hosting your wcf service.

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

Sidebar

Related Questions

I have an ASP.NET MVC web app whose controllers use WCF to call into
Yesterday I began learning WCF by porting an existing ASP.NET Web Service. Creating the
Hi I have just started learning WCF and I have encountered an error I
I spent a long time learning how to customise WCF from the point of
Its a newbie question, and I have just been learning WCF. Can we change
I'm a .net developer with 5 years of experience building asp.net, wcf etc. I
I am currently learning WCF and I have a very weird problem. I have
I have been going through the book Learning WCF trying to get my head
Say I have a web project which uses a WCF service for behind-the-scenes processing,
I'm learning how to access data on a DB using a WCF web service.

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.