I have a webservice method that should create a web part. However, the code gives the below error. But the URL is actually correct!
System.IO.FileNotFoundException: The Web application at
https://mysite.com/ 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.
Here is my code...
public void CreateTempWebPart(string ClientName)
// check registry for site url
string URL = @"https://mysite.com/" + ClientName;
using (SPSite spSiteTest = new SPSite(URL))
SPWeb web = spSiteTest.OpenWeb();
web.AllowUnsafeUpdates = true;
using (SPWeb spWebTest = spSiteTest.OpenWeb())
View Complete Post