title: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) in VS Extensibility walkthrough
body: <p>I am using the <strong><em>Walkthrough: Part 1 - Creating a Basic Project System</em></strong> exactly as written from the website  <a href="http://msdn.microsoft.com/en-us/library/cc512961.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc512961.aspx</a> and the <strong>Managed Package Framework for Projects</strong> exactly as downloaded from <a href="http://mpfproj11.codeplex.com/" rel="nofollow">http://mpfproj11.codeplex.com/</a>.  I have tested the walkthrough on multiple development machines in Visual Studio 2013. I also tested this in Visual Studio 2010 and 2012 using their respective SDK’s.  The same issues to follow presented themselves in each of the tests.</p>
  
  <p>Issue: I am receiving the exception- An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) in the ProjectNode class method:</p>
  
  <pre><code>private void SetProjectGuidFromProjectFile()
          {
              string projectGuid = this.GetProjectProperty(ProjectFileConstants.ProjectGuid);
              if (String.IsNullOrEmpty(projectGuid))
              {
                  this.projectIdGuid = Guid.NewGuid();
              }
              else
              {
                  Guid guid = new Guid(projectGuid);
                  if (guid != this.projectIdGuid)
                  {
                      this.projectIdGuid = guid;
                  }
              }
          }
  </code></pre>
  
  <p>On the line  <code>Guid guid = new Guid(projectGuid);</code></p>
  
  <p>projectGuid is returning the string “$guid1$” which is from <code>&lt;ProjectGuid&gt;$guid1$&lt;/ProjectGuid&gt;</code> in SimpleProject.myproj.</p>
  
  <p>Break points in the Load method of the ProjectNode class shows that </p>
  
  <pre><code>this.projectIdGuid = Guid.NewGuid();
  </code></pre>
  
  <p>returns a new guid such as {6d4b8668-51ca-40eb-b013-9e7f96b82b68}. </p>
  
  <p>In the Reload method of the ProjectNode class the method <code>this.SetProjectGuidFromProjectFile()</code> is fired and then the exeption is thrown as shown above. If I take out <code>&lt;ProjectGuid&gt;$guid1$&lt;/ProjectGuid&gt;</code> in SimpleProject.myproj, I get through to the application without exception but you will have no guid associated with the application and will receive an error if an attempt to access the properties page of the  newly created application. .myproj may not  be registering correctly? I have spent a week researching this topic through various blogs and forums.</p>