Skip to content

ThisAssembly is unusable in old-style NetFX projects. error CS0122: 'ThisAssembly' is inaccessible due to its protection level #301

@ShadowMarker789

Description

@ShadowMarker789

Describe the Bug

In old-style NetFX WPF csproj projects, any attempt to reference ThisAssembly, even typeof(ThisAssembly) will not compile.

error CS0122: 'ThisAssembly' is inaccessible due to its protection level

Steps to Reproduce

In an old-style NetFX WPF csproj C# file, any references to ThisAssembly will not compile.

public class ReproTest
{
  [Fact]
  public void Repro()
  {
    var branchName = ThisAssembly.Git.Branch; // this won't compile. 
  }
}

Expected Behavior

The expectations were that this would compile.

Exception with Stack Trace

No exception, only a build error placed above.

Version Info

1.4.3 via Nuget

Additional Info

Related issues possibly

dotnet/Nerdbank.GitVersioning#404

dotnet/Nerdbank.GitVersioning#449

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions