I have googled it but am unable to find the correct answer to this problem. Below is my code that I used in my development server. Please tell me the exact solution related to that problem:
The Web application at [URL] could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
using (SPSite _Site = new SPSite("http://demo2010a:8082/sites/Test2"))
{
using (SPWeb _Web = _Site.OpenWeb())
{
foreach (SPList list in _Web.Lists)
{
if (count <= 4)
{
string listLink = "<a href='" + list.DefaultView.Url.ToString() + "'>" + list.Title + "</a>(<b>" + list.Items.Count + "</b>)<br>";
linksHtml += listLink;
}
count++;
}
}
}