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

Incremental build after installing NB.GV fails due to generated assemblyinfo attribute collisions in .NET SDK projects #121

Closed
asherber opened this issue Apr 22, 2017 · 4 comments
Assignees
Labels

Comments

@asherber
Copy link
Contributor

I thought this scenario was now supported, but I may have misread. I have a .NET Standard class library in VS2017 targeting netstandard1.4 and net462. When I install GitVersioning, I do not get a project.json file (have to add it manually), and when I build I get errors:

1>obj\Debug\net462\Foo.AssemblyInfo.cs(17,12,17,58): error CS0579: Duplicate 'System.Reflection.AssemblyFileVersionAttribute' attribute
1>obj\Debug\net462\Foo.AssemblyInfo.cs(18,12,18,67): error CS0579: Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute
1>obj\Debug\net462\Foo.AssemblyInfo.cs(21,12,21,54): error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute

Am I doing something wrong, or is this not supported yet?

@AArnott
Copy link
Collaborator

AArnott commented Apr 22, 2017

Yes, it's supported.

You should delete your project.json file. (new) VS2017 projects don't use it. Instead, when you install a package it adds a PackageReference item to your project file.

Your compile errors are due to dotnet/sdk#1142. You can workaround it by deleting that temporary file manually. A "Rebuild" might do it.

@asherber
Copy link
Contributor Author

Sorry, I meant that I don't get a version.json file -- I know that project.json shouldn't be there.

And yes, Rebuild does clear things up.

@AArnott
Copy link
Collaborator

AArnott commented Apr 22, 2017

In the new project type, installing packages never runs the package's install.ps1 script. So you have to create the version.json file yourself.

@AArnott AArnott added bug and removed question labels Apr 22, 2017
@AArnott AArnott reopened this Apr 22, 2017
@AArnott AArnott changed the title Support for multi-targeted libraries? Incremental build after installing NB.GV fails due to generated assemblyinfo attribute collisions in .NET SDK projects Apr 22, 2017
@AArnott AArnott self-assigned this Apr 22, 2017
AArnott added a commit that referenced this issue Apr 22, 2017
Related to #121 but does not fix it.
@AArnott
Copy link
Collaborator

AArnott commented Feb 20, 2018

I hardly hit this any more. I think they fixed it.

@AArnott AArnott closed this as completed Feb 20, 2018
AArnott added a commit that referenced this issue Sep 5, 2022
Update Nerdbank.GitVersioning to enable graph build and optimize perf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants