Skip to content

LangVersion latest and using 11.0 constants  #311

@digitalsigi

Description

@digitalsigi

Describe the Bug

First, this is a great project.

I am working on an project with net6.0. I updated to GitInfo 3.3.1 and get an bunch of errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\BaseTag.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\BaseVersion.Major.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\BaseVersion.Minor.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\BaseVersion.Patch.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\Branch.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\Commit.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\CommitDate.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\Commits.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\IsDirtyString.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\RepositoryUrl.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.DashLabel.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.Label.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.Major.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.Minor.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.Patch.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\SemVer.Source.g.cs	23	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\Sha.g.cs	21	Active
Error	CS8936	Feature 'raw string literals' is not available in C# 10.0. Please use language version 11.0 or greater.	RApp.common	C:\GITatUHU\rapp\src\RApp.common\ThisAssembly.Constants\ThisAssembly.ConstantsGenerator\Tag.g.cs	21	Active

Steps to Reproduce

In csprof or Directory.Build.props set:

<Framework>net6.0</Framework>
<LangVersion>10.0</LangVersion>

Sample generated class

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     ThisAssembly.Constants: 1.4.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Globalization;

partial class ThisAssembly
{
    public static partial class Git
    {
        /// <summary>
        /// => @"0.10.0"
        /// </summary>
        public const string BaseTag = """
0.10.0
""";
    }
}

Expected Behavior

Class should not contain C# 11 syntex

Version Info

GitInfo 3.3.1

Additional Info

Version 3.3.0 worked fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions