question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AssemblyInfo generation skipped on incremental build even if Version/VersionSuffix changes

See original GitHub issue

Steps to reproduce:

  • dotnet new lib
  • dotnet restore
  • dotnet build
  • dotnet build /p:VersionSuffix=alpha
  • dotnet publish /p:Version=1.2.3
  • dotnet pack /p:VersionSuffix=beta

Expected behaviour:

The bin/Debug/netstandard1.4/tmp.AssemblyInfo.cs should be updated on every subsequent build/publish/pack command and the resulting assembly shall contain the requested attributes.

Actual behaviour:

detailed log contains:

Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.

The assembly info is generated only once and only contains 1.0.0 / 1.0.0.0 versions. All published dlls contain this version (even the assembly contained in the npkg - the package is versioned correctly).

System:

C:\Users\martin.ullrich\Documents\tmp>dotnet --info
.NET Command Line Tools (1.0.0)

Product Information:
 Version:            1.0.0
 Commit SHA-1 hash:  e53429feb4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0

Rationale

Since the inputs of CoreGenerateAssemblyInfo is limited to $(MSBuildAllProjects) it is skipped on incremental build when only the command line arguments change. Maybe the file name can be changed to include the Version property so msbuild will see that the output tmp.1.0.0-beta.AssemblyInfo.cs is missing and run the target?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
nguerreracommented, Mar 9, 2017

Hmm, this is tricky because there are other properties that impact the file. I think a complete solution would involve hashing all of those properties and putting it in file name or something.

cc @rainersigwald

0reactions
dasMullicommented, May 26, 2017

Fixed by #1255

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I automatically increment the file build version when ...
In visual Studio 2008, the following works. Find the AssemblyInfo.cs file and find these 2 lines: [assembly: AssemblyVersion("1.0.0.0")] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found