I am using the Walkthrough: Part 1 - Creating a Basic Project System exactly as written from the website http://msdn.microsoft.com/en-us/library/cc512961.aspx and the Managed Package Framework for Projects exactly as downloaded from http://mpfproj11.codeplex.com/. 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.
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:
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;
}
}
}
On the line Guid guid = new Guid(projectGuid);
projectGuid is returning the string “$guid1$” which is from <ProjectGuid>$guid1$</ProjectGuid>
in SimpleProject.myproj.
Break points in the Load method of the ProjectNode class shows that
this.projectIdGuid = Guid.NewGuid();
returns a new guid such as {6d4b8668-51ca-40eb-b013-9e7f96b82b68}.
In the Reload method of the ProjectNode class the method this.SetProjectGuidFromProjectFile()
is fired and then the exeption is thrown as shown above. If I take out <ProjectGuid>$guid1$</ProjectGuid>
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.