SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Error Details:

The Web application at http://dev001aaamaaind:333/ 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.

   string urlSite = "http://dev001aaamaaind:333/";
     using (SPSite sc = new SPSite(urlSite))//Getting Error in the line
        SPWeb site = sc.RootWeb;
        foreach (SPList list in site.Lists)
            if (!list.Hidden)
share|improve this question
up vote 1 down vote accepted

Ok a couple of things to check:

  1. Does the account that you are executing the console application with have permissions to that SharePoint site? - probably best to make the account a Site Collection admin for dev purposes.

  2. Is this a 64-bit or 32-bit environment? If it is 64-bit make sure you target the build of the console app to x64.

Hope this helps,


share|improve this answer

The reason is SharePoint 2010 is a 64 bit application and by default any visual studio solutions complies and excuted in x86 mode. Thus thie error will be encountered.

So you need to compile and run your console application in Any CPU or x64 mode.. preferably go for Any CPU due to some performance reasons.

share|improve this answer

The account that runs the Console Application may not have the required level of database access.

share|improve this answer

share|improve this answer
-1: This isn't a very helpful answer. Linking to another site doesn't help the community that are looking for an answer here. – Alex Angas Nov 14 '10 at 22:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.