Hi,
I am trying to run a simple code like finding all the users in the SharePoint site.
But I am seeing this error constantly no matter what I do!!
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.
I’ve changed project properties ‘Any cpu’ to x64Â and tried but failed.
Thanks
I’ve checked all the suggestions you people gave me with no luck.
Here is a simple code that I am trying to do:
class Program
{
static void Main(string[] args)
{Â Â Â Â Â Â
//site url          Â
string siteurl = https://xxxxx;
using (SPSite site = new SPSite(siteurl))
{Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
//all site users in the sharepoint site  Â
foreach (var users in site.RootWeb.SiteUsers)
{
Console.WriteLine(users);
}
}Â Â Â Â Â Â
Console.ReadKey();
}
}
FileNotFoundException:
The Web application at https://xxxxx 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.
Thanks