Skip to content

[Bug] GitVersionInformation.g.cs(12,42): error CS0234 'ExcludeFromCodeCoverageAttribute' does not exist #2330

@ENikS

Description

@ENikS

Describe the bug

Latest version 5.3.6 fails in .Net Standard 2.0 builds.

Expected Behavior

Expected build to not fail. Version 5.3.5 builds all frameworks correctly.

Actual Behavior

During build of a dll in .Net Standard 2.0 I am getting following error:

  Unity.Abstractions -> D:\a\abstractions\abstractions\src\bin\Release\netstandard2.0\Unity.Abstractions.dll
obj\Release\netstandard1.6\GitVersionInformation.g.cs(12,42): error CS0234: The type or namespace name 'ExcludeFromCodeCoverageAttribute' does not exist in the namespace 'System.Diagnostics.CodeAnalysis' (are you missing an assembly reference?) [D:\a\abstractions\abstractions\src\Unity.Abstractions.csproj]

The generated file fails on line 12:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     GitVersion
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[global::System.Runtime.CompilerServices.CompilerGenerated]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]   <-- This line fails in NETSTANDARD2_0
static class GitVersionInformation
{
    public static string Major = "6";
    public static string Minor = "0";
    public static string Patch = "0";
. . .
}

Possible Fix

Reverted to previous version for now

Steps to Reproduce

For more information please follow this link and examine Build step.

Context

I am using GitVerion tool in CI builds. The library is added to projects during CI steps

Your Environment

netstandard2.1;netstandard2.0;netstandard1.6;netcoreapp3.0;netcoreapp2.0;netcoreapp1.0;net48;net47;net46;net45;net40

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions