Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Error In Getting Portal Site Context

  Asked By: Nicholas    Date: Jan 29    Category: Sharepoint    Views: 7191

We Migrated a Portal site to another server with a different name.
This is a part of a code i have written on the new server.
string localPath = @http://174.18.45.116;
Uri uri = new Uri(localPath);
TopologyManager topMan = new TopologyManager();
PortalSiteCollection sites = topMan.PortalSites;
PortalContext ctx = PortalApplication.GetContext(sites[uri]);
UserProfileManager upManager = new UserProfileManager(ctx);
ArrayList alUserProfiles = new ArrayList();

Whenever it comes to the line get context it thorows up an error value cannot be null with the message below.
Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: sites at Microsoft.SharePoint.Portal.PortalApplication.GetContext(PortalSite site,
PortalZone zone)
This code works fine on the old server.
Request you to let me know where i am going wrong.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Error In Getting Portal Site Context Or get search suggestion and latest updates.




Tagged: