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 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'd like to create alias by script, and use it in bash. Namely: #!/bin/bash
I am trying to create a website where I host my data on google
A single Biztalk Server can have multiple Host processes. Is it possible to create
I create a new Button object but did not specify the command option upon
I am attempting to create and host a simple RESTful WCF Service. The service
I am trying to create a user login/creation script in PHP and would like
I have a snippet to create a 'Like' button for our news site: <iframe
I have an object created in a host application and can access it remotely
create table person ( name varchar(15), attr1 varchar(15), attr2 varchar(1), attr3 char(1), attr4 int

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.