Error: The type or namespace name 'localhost' could not be found (are you missing a using directive or an assembly reference?)

Hi Experts,

I'm using visual studio 2012 and just started building my first web service. When I tried to build my website that host a simple web service, I keep getting this error :
Error1 The type or namespace name 'localhost' could not be found (are you missing a using directive or an assembly reference?)      C:\Users\IT\Documents\Visual Studio 2012\WebSites\Temprature\Temprature.aspx.cs      22 9)
and the code snippet that has this error is :

sing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Temprature : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        localhost.Convert wsConvert = new localhost.Convert();
        double temperature =
        System.Convert.ToDouble(TemperatureTextbox.Text);
        FahrenheitLabel.Text = "Fahrenheit To Celsius = " +
        wsConvert.FahrenheitToCelsius(temperature).ToString();
        CelsiusLabel.Text = "Celsius To Fahrenheit = " +
        wsConvert.CelsiusToFahrenheit(temperature).ToString();
    }
}

Open in new window


So, please guide me to solve this issue.

Thanks a lot in advance.
Harreni
HarreniAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kaufmed   ( ⚆ _ ⚆ )I asked the operating system what I could do to become a better programmer. It said, "Let me give you some pointers."Commented:
Click on "localhost". Next, push Ctrl and period keys. You should get a popup offering suggestions on how to fix. One of those suggestions should be to import the missing namespace. Select that option.
HarreniAuthor Commented:
Thanks a lot käµfm³d for guiding and helping me.
I did what you suggest me to do and I got a long list but I don't know which one is correct.
kaufmed   ( ⚆ _ ⚆ )I asked the operating system what I could do to become a better programmer. It said, "Let me give you some pointers."Commented:
What does the list look like? Can you screenshot it?
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Chris StanyonWebDevCommented:
When you add a Web Reference to your project, it will create the namespace based on your server name, so it will only be called localhost if that's your server name. If you have it named as anything else, then use that name instead.

Check the namespace of your reference - the file will be somewhere in the App_WebReferences folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steven KribbeSoftware EngineerCommented:
remove the localhost. You can just use Convert
HarreniAuthor Commented:
Thanks a lot käµfm³d, Chris and Steven you're all helped me.
I forgot to add "using System.Web.Services;" to my name spaces list
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.