could not find localhost when creating new project

Hi friends
am new to .net and writing a small web service application.am using vs 2005 beta2.

i created new project (asp.net web service) and new project dialog box i selected location as "http" and name of project name i entered as
http://localhost/customer orders webservice and as soon as i click ok i get
following message saying

"Could not find a Web server '<localhost>'. Check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service. "

my question is how can i enable or start my "localhost"
my pc running on win xp prof with sp2.

this is link am using to create my sample app
http://foxcentral.net/microsoft/NETforVFPDevelopers_Chapter12.htm
Thanks for ideas


Answer this question

could not find localhost when creating new project

  • Daniel Pe&amp;#241;alba

    Thanks Chris
    will try to install IIS now.will update you if i have any issues still. Thanks

  • rajeevsahu

    Interesting - I created an empty project, which is what you're running.  I can only assume ISS is not set up properly. F5 gives me the web service help page, and I am able to invoke the HellowWorld method from there.

    BTW, you should replace tempuri with something unique, not localhost.  It's meant to be a unique namespace, which makes a URL a prime candidate, but you can put anything you like, it's for namespacing the XML, and not for any online activity.

  • nlecren12

    The error message you're getting is about XML and XSLT.

    Are you really wanting to create a web service A web service is an app that communicates with clients via the interface you define, and communicates and is communicated with via XML.  It does not have a user interface, it is not a website.

    I'm suspecting you checked 'ASP.NET web service' instead of 'ASP.NET web site' in the new project wizard



  • nathan_coder

    Sorry, so you did.

    It looks to me from looking at the wizard that you can specify a location on the file system instead of HTTP, perhaps that's what you need to do I have IIS installed, so I assume any attempt to create a web site will just find that.  Installing IIS is probably a good idea anyhow, you do have it there.


  • Agnes

    Try creating an ASP.NET web app pointing to localhost, and see if it's able to set itself up correctly to do so.  Running aspnet_regiis should have solved this, but if it didn't, then this will also not work.

  • Debasish

    one more question this
    after creating the project when i run it am getting following error in IE

    The XML page cannot be displayed

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

  • erila

    Are you actually passing XML through an XSLT We often get these sort of errors when dealing with web services, because they send back errors as HTML, if our code still tries to work with the output we receive.

  • rcodarini

    Yes Chris
    I want to create "web service" not site. am using an example from link (in my first post).

    As you can see my code has a method "Hello world" .

    but the error am getting is "A name was started with an invalid character" and i cant figure out whats that char

  • mr_ship

     cgraus wrote:
    Interesting - I created an empty project, which is what you're running.  I can only assume ISS is not set up properly.


    ok How can i find out ISS setup properly
    Yes i restarted my PC after installing IIS .

  • AMMPCP

    >>Are you actually passing XML through an XSLT
    I lost you here . i did not understand what u mean here Chris.

    i have not added any new code there .i've only whatever VS adds when we create a new project.( I just renamed the file name sevices.cs to CustomerOrders.cs)
    my code in this file

    using System;

    using System.Web;

    using System.Web.Services;

    using System.Web.Services.Protocols;

    [WebService(Namespace = "http://localhost/")]

    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

    public class CustomerOrders : System.Web.Services.WebService

    {

    public CustomerOrders () {

    }

    [WebMethod]

    public string HelloWorld() {

    return "Hello World";

    }

    }

    my code in CustomerOrders.asmx file is

    <%@ WebService Language="C#" CodeBehind="~/App_Code/CustomerOrders.cs" Class="CustomerOrders" %>

    and i've only abv 2 files in my solution


  • Ayman Shoukry

    Thanks for the quick reply Christian.
    but as i mentioned i already using vs2005 beta !! where should i go to see whether i got that simple web server
    Thanks

  • oh_maestro

    You are a genious
    Guess what Chris
    I tried again i mean registring aspnet_regiis -i and my web service worked beautifully !!
    Thanks for ur help and Patience Big Smile


  • DJ Phil

    Hi Chris
    i installed IIS from my xp setup cd now i dont get any error when creating project.
    Thanks for ur help mate.

  • BDH

    Windows XP does not install IIS, you need to put the CD back in, and go back to install it.  Then you need to run aspnet_regiis ( it's in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 for my VS2003 install ), you need to use the -i command switch, I believe.  This registers your already installed .NET compiler with IIS, because ASP.NET is basically a big ISAPI filter.  Then you'll have a localhost to use in creating ASP.NET apps. 

    If you download the VS2005 beta, it comes with a simple web server.


  • could not find localhost when creating new project