views:

11

answers:

2

Error Details:

  1. 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)
                        Console.WriteLine(list.Title);
                }
            }
    
A: 

Make sure that you have set the Platform in the Project Properties Build tab to either to x64 or Any CPU. This is one common issue that hit when developing using SharePoint 2010 as it is based on 64 bit Arch.

Kusek
thanks man i solved it already..U are the only guy reply for sharepoint question from india!!!
Ayyappan.Anbalagan
@Ayyappan: Glad that you got it solved, it would be helpful for others to know how it solved it, share your answer. Lots of people out there in SO for SharePoint :)
Kusek
What ever u replied same thing i did to solve this issue.
Ayyappan.Anbalagan
Mark it as Answer so that it will help someone.
Kusek