Link to home
Start Free TrialLog in
Avatar of Harreni
HarreniFlag for Saudi Arabia

asked on

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
SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Harreni

ASKER

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.
What does the list look like? Can you screenshot it?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Harreni

ASKER

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