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.

Is there a mechanism to control the AssemblyFileVersion independently from AssemblyVersion in MsBuild?

See original GitHub issue

Hi

We are trying to save consumer frameworks and users the hassle of having to add assembly binding redirects when they upgrade minor/patch versions of Castle Core used as transitive dependencies. The issue where we are exploring this is here.

In summary this is what we landed on:

@stakx -> This line in Microsoft.NET.GenerateAssemblyInfo.targets suggests that it might be possible to add a <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> to the .csproj, then define that attribute manually. I haven’t tried it myself, though. (If that doesn’t work, then try the much coarser-grained <GenerateAssemblyInfo>false</GenerateAssemblyInfo>. I’ve used this before and it works, but it means you might then have to keep certain attributes in Castle.Core.csproj and AssemblyInfo.cs in sync manually.)

Is there a tidy way we can achieve this without adding an AssemblyInfo.cs?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
dasMullicommented, May 23, 2018

Yes each attribute can be controlled individually by setting

<PropertyGroup>
  <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>

The pattern is Generate{AttributeName}Attribute, if you don’t mind reading msbuild code the full list is here.

1reaction
ghostcommented, Aug 1, 2017

@dasMulli - Many thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use AssemblyVersion and AssemblyFileVersion attributes
This article describes how to use AssemblyVersion and AssemblyFileVersion attributes in the AssemblyInfo.cs file.
Read more >
.net - What are differences between AssemblyVersion ...
The AssemblyVersion is used by the CLR to bind to strongly named assemblies. It is stored in the AssemblyDef manifest metadata table of...
Read more >
MSBuild task to update AssemblyVersion and ...
This means, set the major version to 1, set the minor version to 2, increment the revision number and leave the build number...
Read more >
What is the difference between Version, AssemblyVersion ...
AssemblyVersion is only really used when being loaded by the CLR (I think), as I believe it is part of the assembly's 'signature',...
Read more >
Setting assembly and nuget package metadata in .NET Core
How to properly manage artifacts metadata in SDK projects.
Read more >

github_iconTop Related Medium Post

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