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

Assembly version is missing build and revision numbers #53

Closed
Euphoric opened this issue Feb 8, 2018 · 14 comments
Closed

Assembly version is missing build and revision numbers #53

Euphoric opened this issue Feb 8, 2018 · 14 comments

Comments

@Euphoric
Copy link

Euphoric commented Feb 8, 2018

Version 0.0.43 is missing assembly version. When this assembly is references in csproj, it shows as

<Reference Include="Ben.Demystifier, Version=0.0.0.0, Culture=neutral, PublicKeyToken=a6d206e05440431a, processorArchitecture=MSIL">
  <HintPath>..\packages\Ben.Demystifier.0.0.43\lib\net45\Ben.Demystifier.dll</HintPath>
</Reference>

Version 0.0.8 shows as

<Reference Include="Ben.Demystifier, Version=0.0.8.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\packages\Ben.Demystifier.0.0.8\lib\net45\Ben.Demystifier.dll</HintPath>
</Reference>

While this is not a problem by itself. It does cause breakage in any libraries that depend on Ben.Demystifier.

For example, if codeessentials.Extensions.Logging.Demystifier is installed, it works fine with 0.0.8 ,but loading exception is thrown for 0.0.43 :

Could not load file or assembly 'Ben.Demystifier, Version=0.0.4.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

@Euphoric Euphoric changed the title Missing file version Missing Assembly version Feb 8, 2018
@Euphoric
Copy link
Author

Euphoric commented Feb 8, 2018

I did some research around Nerdbank.GitVersioning and found two possible solutions.

First is to increase precision of assembly version in version.json like

  "assemblyVersion": {
    "precision": "build"
  },

Second option is to always increase minor version for new release. So next NuGet should be 0.1 not 0.0

@Euphoric Euphoric changed the title Missing Assembly version Assembly version is missing build and revision numbers Feb 8, 2018
@Euphoric
Copy link
Author

Euphoric commented Feb 8, 2018

@onovotny You were the one who implemented this, how should this situation be handled?

@Euphoric
Copy link
Author

Euphoric commented Feb 8, 2018

Also, it would be great if next release was made soon and 0.0.43 package marked as not-to-be-used. So the version problems don't spread around.

@clairernovotny
Copy link

clairernovotny commented Feb 8, 2018 via email

@Euphoric
Copy link
Author

Euphoric commented Feb 8, 2018

Thanks @onovotny for clarifying. But that is not the problem. The problem is that previous NuGet package 0.0.8.0 has assembly version 0.0.8.0. And next version 0.0.43.0 has version 0.0.0.0 . So if a 3rd party library depends on 0.0.8.0 , but 0.0.43.0 is installed, then .NET thinks old version is present based on assembly version and fails with exception.

Either increase precision of assembly version to include at least build number , or make sure to always increase minor version when releasing new NuGet package.

@benaadams
Copy link
Owner

Prob should release a 0.1

@clairernovotny
Copy link

clairernovotny commented Feb 8, 2018 via email

@Euphoric
Copy link
Author

Euphoric commented Feb 8, 2018

@onovotny That is not true. 0.0.43 is higher NuGet version but it is not higher Assembly version.

Here is sample project
BenDemystifyTest.zip

It has codeessentials.Extensions.Logging.Demystifier installed. This is built against 0.0.4.0 , but 0.0.8.0 is installed and it works. But after upgrading to 0.0.43 , the exception I posted in top comment is thrown. So it is not exact match and no redirect is needed. But only if Assembly version is greater than 0.0.4.0, which it isn't for 0.0.43 NuGet package.

@clairernovotny
Copy link

clairernovotny commented Feb 8, 2018 via email

@clairernovotny
Copy link

clairernovotny commented Feb 8, 2018 via email

@benaadams
Copy link
Owner

@benaadams
Copy link
Owner

Submitted updates to various projects nblumhardt/serilog-enrichers-demystify#6, MNie/Log4Net.Demystifier#1, twenzel/Demystify.Everything#6 (codeessentials)

@benaadams
Copy link
Owner

Should be resolved

@dhazel
Copy link

dhazel commented Jul 19, 2019

My issue #87 may be related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants