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

  • Home
  • SEARCH
  • 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 3454856
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:32:34+00:00 2026-05-18T09:32:34+00:00

I create my host with the endpointaddress it needs to use, like this: Uri

  • 0

I create my host with the endpointaddress it needs to use, like this:

Uri endpointAddress = new Uri("http://127.0.0.1:5555/MyService");
ServiceHost host = new ServiceHost(myServiceType, endpointAddress);
host.AddServiceEndpoint(implementedContract, basicHttpBinding, string.Empty);

but when I later do host.Open(); I get the exception “HTTP could not register URL http://+:80/MyService/ because TCP port 80 is being used by another application”. The result is the same when I do

host.AddServiceEndpoint(implementedContract, basicHttpBinding, endpointAddress);

Why would it try to do anything with port 80? How can I solve this?

Update
While trying to provide a more complete code sample, I found the culprit. I added a ServiceMetadataBehavior as follows:

ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.ExternalMetadataLocation = new Uri(this.ExternalMetadataLocation);
smb.HttpGetEnabled = true;
smb.HttpGetUrl = this.RemovePort(this.EndpointAddress);
host.Description.Behaviors.Add(smb());

It seems that in the past I needed to remove the port from the URL to get this to work, but now that’s exactly what causes the problem.

So Pratik is right: metadata were the problem, and of course the problem with port 80 is that there’s some newly installed application using that port.

Thanks, regards,

Miel.

  • 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-18T09:32:35+00:00Added an answer on May 18, 2026 at 9:32 am

    This is because port 80 is already used by another applicatiion as the error message says, most likely by local IIS server. Try stopping IIS and see, or use another port.
    On vista and above you can use netsh command to check which ports are already reserved

    BTW do you have http metadata or mex endpoints in the app.config or web.config file ?

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

Sidebar

Related Questions

How can I dynamically create a host name in ASP.NET? Like if people come
I am attempting to create and host a simple RESTful WCF Service. The service
I have a WFC(4.0) service dll for which I have to create a host
I am trying to create a website where I host my data on google
I'm trying to create a rich text DataGridViewCell. I can host a RichTextBox as
I am looking for a way to create/detect a cookie on a local host
A single Biztalk Server can have multiple Host processes. Is it possible to create
I want to create a virtual host in apache such that it serves only
I'm trying to learn how to create a WCF Service and host in on
I see more and more sites that create vhosts and host files on static.theirdomainname.com.

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.