Unit test for creating a SharePoint site fails

Shiraz Bhaiji
  • Unit test for creating a SharePoint site fails Shiraz Bhaiji

    I have some code that creates a SharePoint site.

    When the code runs as part of the solution it works. However, when I run it as a unit test I get the following error:

    The test adapter 'WebHostAdapter' threw an exception while running test 'CreateSiteTest'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error. The remote server returned an error: (500) Internal Server Error.

    I have the following tags on my test:

    [TestMethod()] 
    [HostType("ASP.Net")] 
    [UrlToTest("http://localhost/SitePages/Home.aspx")]  
    

    Any idea why I am getting this error?

Tags
visual-studio unit-testing
Related questions and answers
  • from the server on which SharePoint is running, using the internal domain name (e.g. http://localhost:5050/site). If I view the site home page while not logged in, I can't see the webpart -- this is the correct behaviour. However, if I view the site via the public address (e.g. http://www.realaddress.co.uk:5050/site) while not logged in, I can see the webpart. (I shouldn't be able...I have a web part which I am trying to target to a specific audience (the 'Staff' audience.) I have the web part in the home page of a site that has anonymous access enabled. I have set the Target

  • additional information. The following sample code reproduces the problem: var service = new SiteData(); service.Url = url + "_vti_bin/sitedata.asmx"; string web;string site;string bucket;string list.... The error I get is: Server was unable to process request. ---> Access is denied. System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Access is denied... does not work. (http://localhost/_vti_bin/listdata.svc/List hangs indefinitly) Livewriter can not connect to blog site opening office documents in edit mode gives access denied, but they can actually

  • I have a new SharePoint 2010 server farm that I'm trying to configure. Installation went fine. But I'm having trouble getting the user profiles to import. I've created the User Profile service application, and the two user profile services are running. However, whenever I try to create a synchronization connection to our AD servers, I'm getting the following error: "The operation was aborted because the client side timeout limit was exceeded." In the SharePoint logs, when I filter based on the correlation ID, I get the following messages: Name=Request (POST:http://poc-bi-sp:8080/_layouts

  • I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I met with strange SharePoint internal error when click some links on a web site. I have tried to use SPTraceView (http://sptraceview.codeplex.com/) to dump related logs, I find the following error logs, any ideas what is wrong? I am not sure whether in my scenario, using SPTraceView is the best way to diagnose, any better ideas to diagnose? Application Server Job failed for service instance Microsoft.Office.Server.Search.Administrator.SearchServiceInstance(xxxxxxxx-xxx GUID) Reason: access to file "C

  • , at the Powershell prompt I get only the following output: User cannot be found. If I look into the ULS logs, I see the following related logs (truncated a bit for clarity): Creating site http://somehost/sites/test in content database WSS_Content_768e4db1bf23493085857cd381b2f72e Error when trying to get trusted forests and domains. Exception message: Current security context is not associated... to contact the global catalog server If I create a site collection through Central Administration, using the same <domain\user.name> credentials, the site collection is created fine. Any ideas

  • . The only significant thing to change on the server between yesterday and today was the installation of the Citrix Web Interface for SharePoint webparts. UPDATE: I also receive the following error when starting Central Administration from the Start Menu (Start -> Microsoft Office Server -> SharePoint 3.0 Central Administration) A failure occurred when accessing the HKEY_LOCAL_MACHINE\Software... SPUtility.GetGenericSetupPath("config") is returning null. I set up a test console app and sure enough, SPUtility.GetGenericSetupPath("config") returns null. So something is obviously severely hosed somewhere. I noticed when

  • I want to create a new SharePoint 2010 farm using PowerShell. I use the following command: New-SPConfigurationDatabase When issuing this command (and providing the needed parameters) I get the following error: New-SPConfigurationDatabase : This SharePoint farm currently has pending upgrades. The cmdlet New-SPConfigurationDatabase cannot be executed until the upgrade is completed. When running the "SharePoint 2010 Products Configuration Wizard" I'm able to create a farm. I have a freshly installed Windows Server 2008 R2 with SQL 2008 R2 on the same box (it's a demo box

  • Scenario: We have an internal application that ties Excel spreadsheets stored in a SharePoint doc lib with specific Opportunities in CRM. The user clicks on a button in the Opportunity and a Web... to them by SharePoint as read-only (so they will get the above error message). However, often they are demonstrably the only user to have accessed the document - in fact, sometimes this will happen... is causing this behavior? I can change the code to avoid it if I can figure out why it is happening. Is there any way through the SharePoint UI or APIs to "release" the document so that the original

  • , when I try to restore, I get the following errors: Provisioning of the web application, SharePoint - 1234, has encountered the following error: System.ArgumentException: The IIS Web Site you have...I am trying to find the best way to accomplish the following: Move an existing share point application's content and meta databases, back them up and restore them to a different machine. In order to do this I am using the stsadm tool as follows: To backup, I use this command: stsadm -o backup -url http://devpn-004:1234 -directory c:\sharePointBackup -filename testBackup.bak -backupmethod full

Data information