Does anybody know why SPSite.Exists(url) return false although the url exists.
If I check the above statement, it returns false.
But I can open the site without any problems if I directly use
SPSite myRootSite = new SPSite(url);
Here is my coding .
if (SPSite.Exists(new Uri(url)))
{
SPSite myRootSite = new SPSite(url);
}
UPDATE :
Sorry , I was calling SharePoint from one of my business layer which is not allowed.
My Fault !!
Actually the method SPSite.Exists tries to create a site from your Url and try-catches an exception. Besides that it performs paths comparison that might be unnecessary for you. So if you create your own method to check if the site exists that will be much more than OK.
this method might look like