.NET Tips and Tricks

Blog archive

SharePoint GUID Collision Avoidance

SharePoint developers working in Visual Studio 2010 know that GUID collisions can be a needless nuisance. Brian Watts sent along this tip that he got from one of Doug Ware's tutorials on SharePoint. Brian adds a pre-deployment command to his Visual Studio build-deploy-debug process that deletes and recreates his SharePoint site before he does any testing. Brian says he can't remember the last time he had a problem with a GUID clash.

To make this happen, in your SharePoint 2010 project, go into the Properties window, select the SharePoint tab, and add the following code to the pre-deployment Command Line box at the top of the window:

stsadm -o deletesite -url <url for his site>
stsadm -o createsite -url <url for his site> 
     -owneremail <your email>
     -ownerlogin <your admin id, including the domain name>
     -siteTemplate "STS#1"
     -description "A test site"
     -title "Test Site"

Brian says it might be adding a couple of seconds whenever he presses F5, but that delay is more than worth the benefits of avoiding any problems.

Do you have a Visual Studio tip, you'd like to share? Send it to me at [email protected].

Posted by Peter Vogel on 03/29/2011


comments powered by Disqus

Featured

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

  • Copilot Agentic AI Dev Environment Opens Up to All

    Microsoft removed waitlist restrictions for some of its most advanced GenAI tech, Copilot Workspace, recently made available as a technical preview.

Subscribe on YouTube