We help IT Professionals succeed at work.
Get Started

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

Last Modified: 2016-04-16
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 =
        FahrenheitLabel.Text = "Fahrenheit To Celsius = " +
        CelsiusLabel.Text = "Celsius To Fahrenheit = " +

Open in new window

So, please guide me to solve this issue.

Thanks a lot in advance.
Watch Question
Most Valuable Expert 2020
Most Valuable Expert 2018
This problem has been solved!
Unlock 3 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE