Scneario : Webserver with ASP.NET site. Installed Sharepoint 2010 SQL Express edition on the same server. SQL resides on the same box.
The ASP.NET runs on appPool1 with identity "SiteUser". The Sharepoint site that was created by the wizard has created new app-pool and the app-pool is set with network identity as 'Networkservice account'
Within one of the pages (common.aspx.cs), I read the sharepoint site using the below code.
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(cSPSite))
{
...
}
});
Here are the errors.
The Web application at http://x2009:190/ 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 did google a bit and no success yet. I can't compile this as it is ASP.NET site. I tried to change the identity of sharepoint site to be that of ASP.NET site (siteuser) and error still remains and this time my sharepoint site (when browsed separately) gives 'cannot connect to configuration database'. I even tried to change the sharepoint site to point the same app-pool that ASP.NET uses but no success so far.
Please suggest.
You should check whether this sitename http://x2009:190/ is registered in SharePoint as alternative mapping (or something like this) also it must be exactly x2009 without any .bla.bla. Also this user must have security rights to use webservices (set up in SharePoint).