The manual should contain 32 digits with four dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) in the passage of VS Extensibility

I am using the Walkthrough: Part 1 - Creating a basic project system in the same way as written on the website http://msdn.microsoft.com/en-us/library/cc512961.aspx and Managed Package Structures for projects in exactly the same way as downloaded from http://mpfproj11.codeplex.com/ . I tested the walkthrough on several development machines in Visual Studio 2013. I also tested this in Visual Studio 2010 and 2012 using their respective SDKs. In each of the tests, the same problems were present.

Problem: I get an exception. An exception of type "System.FormatException" occurred in mscorlib.dll, but was not handled in the user code. Additional information: Guid must contain 32 digits with four dashes (xxxxxxxx-xxxx-xxxx- xxxx-xxxxxxxxxxxx) in the method of the ProjectNode class:

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;
                }
            }
        }

In line Guid guid = new Guid(projectGuid);

projectGuid returns the string "$ guid1 $", which is from from <ProjectGuid>$guid1$</ProjectGuid>in SimpleProject.myproj.

Break points in the Load method of the ProjectNode class indicate that

this.projectIdGuid = Guid.NewGuid();

returns a new pointer, for example {6d4b8668-51ca-40eb-b013-9e7f96b82b68}.

ProjectNode this.SetProjectGuidFromProjectFile(), , . <ProjectGuid>$guid1$</ProjectGuid> SimpleProject.myproj, , , , , ..myproj ? , .

+4
1

- , MPF ( , , ) ( Visual Studio: http://msdn.microsoft.com/en-us/library/eehb4faa.aspx), (sub), . , $guid1 $ $thingy $ xxxx.myproj.

, $guid1 $ , MPF :

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    ...
    <ProjectGuid></ProjectGuid>
    ...
  </PropertyGroup>
  ...
</Project>

, :) . ProjectIDGuid ProjectNode.

, , - . , Visual Studio __ VSHPROPID2.VSHPROPID_PropertyPagesCLSIDList. MPF :

    /// <summary>
    /// List of Guids of the config independent property pages. It is called by the GetProperty for VSHPROPID_PropertyPagesCLSIDList property.
    /// </summary>
    /// <returns></returns>
    protected virtual Guid[] GetConfigurationIndependentPropertyPages()
    {
        return new Guid[] { Guid.Empty };
    }

Guid.Empty - ( ), , , , :

enter image description here

, GetConfigurationIndependentPropertyPages Guid, , SettingsPage .., .

+3

Source: https://habr.com/ru/post/1542678/


All Articles