Project-system: Adding a new type to a class designer file shows an error

Created on 29 Nov 2017  路  10Comments  路  Source: dotnet/project-system

  1. Create a new Console App (.NET Core)
  2. Right-click project -> Add -> New Item -> Class Diagram
  3. Right-click on the diagram and choose Add Class

Expected: For a new file to be added
Actual:

---------------------------
Microsoft Visual Studio
---------------------------
The XPath query / is not supported.
---------------------------
OK   
---------------------------
Bug Parity-Legacy-API Parity-Legacy-Feature Resolution-Fixed

Most helpful comment

This is very disappointing. Class Diagram support in VS 2017 for C# Core has been buggy for 6+ months. I just downloaded the latest patch version and it still does not work.

It is a great productivity feature when creating your initial models for new projects and the only practical way to visualize larger models.

Very disappointing.

All 10 comments

The underlying cause here is that ProjectTypeGuid ("Kind") that we're returning is not recognized so CodeController.GetLanguage is throwing:

``` C#

            string kind = owner.Project.Kind;
            if (string.Compare(kind, ProjectKinds.CSharpProjectKind, StringComparison.Ordinal) == 0)
                result = CodeHandler.CMLanguageCSharp;
            else if (string.Compare(kind, ProjectKinds.VBProjectKind, StringComparison.Ordinal) == 0)
                result = CodeHandler.CMLanguageVB;
            else if (string.Compare(kind, ProjectKinds.CppProjectKind, StringComparison.Ordinal) == 0)
                result = CodeHandler.CMLanguageCPP;
            else
                throw new System.NotSupportedException(CodeHandler.CodeHandlerExceptions.CDUnknownLangNotSupported(kind));

```

@davkean have you solved the problem with "The XPath query / is not supported." error?

Bumping this for a status update as well. :)

This is very disappointing. Class Diagram support in VS 2017 for C# Core has been buggy for 6+ months. I just downloaded the latest patch version and it still does not work.

It is a great productivity feature when creating your initial models for new projects and the only practical way to visualize larger models.

Very disappointing.

I guess we will have to try and do it ourselves. Unfortunately it seems that parts of the buggy code is proprietary, and thus not available for us to change.

Microsofties, I've an internal PR for this here: https://devdiv.visualstudio.com/DevDiv/_git/CPS/pullrequest/122409?_a=files.

@davkean any chance there is an ETA the resolution? ETA to customers that is.

The above PR unblocks some portion of the class diagram code so that it recognizes the project system, but until we've tested it end-to-end I cannot give a timeline.

I've confirmed the above PR gets further, but it's sometimes running into:

---------------------------
Microsoft Visual Studio
---------------------------
The code for C:\Users\davkean\Source\Repos\ConsoleApp334\ConsoleApp334\Class3.cs is not ready to be read yet. In some cases, saving all files and generating again will fix this issue.
---------------------------
OK   
---------------------------

Which underneath is caused by: https://github.com/dotnet/project-system/issues/2544, which we are also tackling in 15.8.

This exact issue will be fixed in 15.8 Preview 3, however, as mentioned above there is sometimes still an issue when adding a file as mentioned above. That cause is being tracked by https://github.com/dotnet/project-system/issues/2544.

Was this page helpful?
0 / 5 - 0 ratings