Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LangVersion latest and using 11.0 constants #311

Closed
digitalsigi opened this issue Aug 30, 2023 · 4 comments · Fixed by devlooped/ThisAssembly#262 or #312
Closed

LangVersion latest and using 11.0 constants #311

digitalsigi opened this issue Aug 30, 2023 · 4 comments · Fixed by devlooped/ThisAssembly#262 or #312
Labels

Comments

@digitalsigi
Copy link

digitalsigi commented Aug 30, 2023

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

@kzu
Copy link
Member

kzu commented Aug 30, 2023

This is quite weird, since the generator explicitly checks for lang version 11+: https://github.com/devlooped/ThisAssembly/blob/main/src/ThisAssembly.Constants/ConstantsGenerator.cs#L50-L51, and the only change from 3.3.0 > 3.3.1 was removing SponsorLink v1.... 😕

@kzu
Copy link
Member

kzu commented Aug 30, 2023

@kzu
Copy link
Member

kzu commented Aug 30, 2023

Shipping in v3.3.2

@kzu
Copy link
Member

kzu commented Aug 30, 2023

If you enjoyed the quick turnaround for the fix, please consider sponsoring at https://github.com/sponsors/devlooped/ 💜

@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants