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

Fix library versioning: reading version from assembly #196

Merged
merged 2 commits into from
Oct 22, 2023

Conversation

slorello89
Copy link
Member

Fixes issue where NRedisStack was trying to read NRedisStack version out of the csproj file. What this means in practice is that any time anyone uses the nuget package for anything related to NRedisStack (any module commands), you would see an error e.g.:

Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/src/NRedisStack/NRedisStack.csproj'.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)

The proper way to pull the version is by using the assembly. Produces a traditional Microsoft version number (e.g. 0.10.1.0) - Major.Minor.Build.Revision - that should be fine though.

@chayim chayim added the bug Something isn't working label Oct 22, 2023
@chayim chayim changed the title Reading version from assembly rather than from csproj Fix library versioning: reading version from assembly Oct 22, 2023
@chayim
Copy link
Contributor

chayim commented Oct 22, 2023

@shacharPash after this let's make sure a release is all well and good (.10.1). Similarly in parallel to CSC can you take a look at #195

// Load the .csproj file.
var csprojDocument = XDocument.Load(csprojFilePath);
return csprojDocument;
return typeof(NRedisStack.Auxiliary).Assembly.GetName().Version.ToString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slorello89 Thanks for noticing, I actually already fixed it and probably deleted it by mistake.
This line specifically will return a version of type: x.y.z.x no?
Because I want it to be x.y.z, without the fourth digit.

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (01e823c) 94.06% compared to head (b99a6e7) 94.05%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
- Coverage   94.06%   94.05%   -0.01%     
==========================================
  Files          85       85              
  Lines        5186     5178       -8     
  Branches      488      488              
==========================================
- Hits         4878     4870       -8     
  Misses        181      181              
  Partials      127      127              
Files Coverage Δ
src/NRedisStack/Auxiliary.cs 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shacharPash shacharPash merged commit 50fb74a into master Oct 22, 2023
@shacharPash shacharPash deleted the bugfix/pull-version-from-assembly branch October 22, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants