I have a SharePoint site collection. The root Web of the site collection has the URL http://intranet.com. I plan to create a user solution that will contain a Web Part. The Web Part will display the title of the root Web.
I wrote the following code segment for the Web Part.
SPSite currentSite = new SPSite("http://intranet.com");
Label currentTitle = new Label();
currentTitle.Text = currentSite.RootWeb.Title;
I added the Web Part to a page in the root Web and receive the following error message: "Web Part Error:Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred."
What should I do? :(