Skip to content

CS0229: Ambiguity between 'ThisAssembly.Info.Description' and 'ThisAssembly.Info.Description' when using Unclassified.NetRevisionTask #349

@MagicAndre1981

Description

@MagicAndre1981

Describe the Bug

some entries are generated twice, causing error CS0229: Ambiguity between 'ThisAssembly.Info.Description' and 'ThisAssembly.Info.Description'

Steps to Reproduce

add this config data from Unclassified.NetRevisionTask to Directory.Build.props :

<PropertyGroup>
		<NrtRevisionFormat>{semvertag}</NrtRevisionFormat>
		<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
		<NrtResolveInformationalAttribute>true</NrtResolveInformationalAttribute>
		<NrtResolveCopyright>false</NrtResolveCopyright>
		<NrtTagMatch>v[0-9]*</NrtTagMatch>
		<NrtRemoveTagV>true</NrtRemoveTagV>
		<NrtRequiredVcs>svn</NrtRequiredVcs>
		<NrtShowRevision>true</NrtShowRevision>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
		</PackageReference>
	</ItemGroup>

and

[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("1.2.{revnum}.0")]

to AssemblyInfo.cs to let Unclassified.NetRevisionTask generate the 3rd number based on the commit number from subversion (Yes, I still use subversion).

Expected Behavior

only 1 entry in generated code

Version Info

    <PackageReference Include="ThisAssembly" Version="1.4.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>

Additional Info

image

image

Here you can see the doubled entries.

I want to replace my older runtime code

copyrightAttribute = assembly
				.GetCustomAttributes<AssemblyCopyrightAttribute>(false)
				.FirstOrDefault();

to get Copyright and others with your generated code and here I noticed this conflict.

Unclassified.NetRevisionTask merges all finished calculations into a file called NrtAssemblyInfo.cs.

So is it possible to detect this package and only use the data from the NrtAssemblyInfo.cs?

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