troubleshooting Question

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

Avatar of Harreni
HarreniFlag for Saudi Arabia asked on
C#ASP.NET.NET ProgrammingMicrosoft IIS Web Server
6 Comments3 Solutions675 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 3 Answers and 6 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 3 Answers and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004