Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:31:29+00:00 2026-06-01T16:31:29+00:00

I am working on a project which should connect the Yahoo Weather API with

  • 0

I am working on a project which should connect the Yahoo Weather API with ASP.Net MVC 3
After I have created the variables it has given me the error called “The type or namespace name ‘WeatherForecast’ could not be found (are you missing a using directive or an assembly reference?) C:\Users\kumi.SH\Documents\Learn\ASP.Net_MVC3\WeatherApp\WeatherApp\Controllers\HomeController.cs”

I have the following code in my HomeController.cs file:

public ActionResult GetWeather(string Id)
{
    StringBuilder sb = new StringBuilder();
    WeatherForecast wf = new WeatherForecast();
    WeatherForecasts wfs = wf.GetWeatherByPlaceName(Id);
    WeatherData[] wd = wfs.Details;
    sb.AppendFormat("<B>Weather Forecast for {0}</B><br /><br />", wfs.PlaceName);
    foreach (WeatherData d in wd)
    {

        if (!string.IsNullOrEmpty(d.WeatherImage))
        {
            sb.AppendFormat("<img src=\"{0}\" >", d.WeatherImage);
            sb.AppendFormat(" {0}", d.Day);
            sb.AppendFormat(", High {0}F", d.MaxTemperatureF);
            sb.AppendFormat(", Low {0}F<br />", d.MinTemperatureF);
        }
    }
    Response.Write(sb.ToString());
    return null;
}

Can you please specify the namespaces which needs to use?

Thankx in advance……

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:31:30+00:00Added an answer on June 1, 2026 at 4:31 pm

    It looks like your application uses the following web service?

    http://www.webservicex.net/weatherforecast.asmx

    If so, you will need to add a Service Reference to this service within the same project that you are trying to use it. I.e. the same project where the code in your example lives. Judging from the path in your example, that project is called “WeatherApp”.

    You can do this by right clicking on the project node in Solution Explorer and selecting “Add Service Reference”. Then in the dialog that appears paste the service url (above) into the address bar and hit “Go” – Give it a name and then click “Ok”

    Add Service Reference Image

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an ASP.NET MVC project and I am trying to get
I'm working on a project of which I should store constant multi dimensional arrays.I
I am working on a project which was developed in Visual Studio 2005 (.NET
I have been working on a project which is about data copy from one
I'm currently working on my first MVC project which is nothing more than a
I'm working on a school project which should give students the ability to search
I am working on a project in which I have to create a tagging
I'm working on a project which uses the following technologies: C# (.NET 4.0) WCF
I have developed a project which should run only in landscape mode. I set
I am working on a Django project in which users should be allowed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.