-
Notifications
You must be signed in to change notification settings - Fork 656
Description
My project has a namespace like Foo.System. Since you use the fully qualified namespace of the attribute [System.Runtime.CompilerServices.CompilerGenerated] for the GitVersionInformation class and since it is nested within the Foo.System namespace of my project it won't compile because the compiler is looking for a Runtime namespace within Foo.System which doesn't exist. The solution is to add a using System.Runtime.CompilerServices; line and adorn the class with just [CompilerGenerated] like so:
using System;
using System.Reflection;
using System.Runtime.CompilerServices; // Add this line
[assembly: AssemblyVersion(""{0}"")]
[assembly: AssemblyFileVersion(""{1}"")]
[assembly: AssemblyInformationalVersion(""{2}"")]
namespace Foo.System
{
// Modify this line
// Compiler sees this line as [Foo.System.Runtime.CompilerServices.CompilerGenerated], there is no Runtime in Foo.System
[System.Runtime.CompilerServices.CompilerGenerated]
// To this
[CompilerGenerated]
static class GitVersionInformation
Now there is no more conflict. Ideally it would be nice if the auto-generation of GitVersionInformation was configurable and not hard-coded in AssemblyInfoBuilder.cs. Or if you provided a template file for GitVersionTaskAssemblyInfo.g.cs that could be customized.
Thank you for your help.