Skip to content

Build error: MSML_TypeParamName reports "TType" as not standard #6528

@andrasfuchs

Description

@andrasfuchs

System Information (please complete the following information):

  • OS & Version: Windows 11 v10.0.22621.963
  • ML.NET Version: ML.NET v2.0
  • .NET Version: .NET 7

Describe the bug
After successfully building the ML.NET project when I try to build it again in Visual Studio, I get the "Type parameter name 'TType' not standard" error and the build fails.

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repo
  2. Run the build.cmd in PowerShell
  3. Open the Microsoft.ML.sln solution in Visual Studio 2022
  4. Try to build the project (F6)
  5. (optional) Open a source file that causes the failure (eg. NormalizeColumnSng.cs)
  6. See the errors in the Error List window

Expected behavior
As described in this document, I would expect the build command to work in Visual Studio.

Screenshots, Code, Sample Projects
image

Additional context
I use Visual Studio Enterprise 2022 v17.4.3.

If I refactor the type TType to TTest then it works fine.

I also tried to keep the TType class name, and change the condition in TypeParamNameAnalyzer class from

if (name == null || (name.StartsWith("T") && Utils.NameIsGood(name, 1, true))) return;

to

if (name == null || (true && Utils.NameIsGood(name, 1, true))) return;

and it made it work, I could build the solution without any errors.

It doesn't make any sense to me, I hope someone else will understand what's the underlying issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions