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

[Bug] /updateassemblyinfo filename does not work anymore #2270

Closed
nix63 opened this issue May 12, 2020 · 6 comments
Closed

[Bug] /updateassemblyinfo filename does not work anymore #2270

nix63 opened this issue May 12, 2020 · 6 comments
Assignees
Labels
Milestone

Comments

@nix63
Copy link

nix63 commented May 12, 2020

In a MSVS 2019 project I've configured a prebuild step execution with this command
gitversion /updateassemblyinfo $(SolutionDir)GlobalAssemblyInfo.cs /ensureassemblyinfo

This worked well with previous versions of GitVersion and the GlobalAssemblyInfo.cs file was generated with the info expected

With version 5.3.2, the GlobalAssemblyInfo.cs file specified in the command line is not created and the AssemblyInfo.cs files in the solution are updated.

Is this the expected behavior?

@nix63 nix63 added the bug label May 12, 2020
@arturcic
Copy link
Member

well the path of the assemblyInfo you want to update should be relative to the root folder that contains the .git, or relative to the directory the gitversion is run from. So in your case change the
$(SolutionDir)GlobalAssemblyInfo.cs with the appropriate value, or

you can use the Glob pattern (also relative to the directory the tool runs)
similar to **/GlobalAssemblyInfo.cs
you can find other examples here https://github.com/GitTools/GitVersion/blob/master/src/GitVersionExe.Tests/ArgumentParserTests.cs#L307-L384

@nix63
Copy link
Author

nix63 commented May 12, 2020

Sorry, the $(SolutionDir) is a Visual studio variable which is replaced at build time with the complete solution path.
But if I open a command prompt, move to the path containing .git directory and run the command
gitversion /updateassemblyinfo GlobalAssemblyInfo.cs /ensureassemblyinfo
the GlobalAssemblyInfo.cs file is not created with version 5.3.2.
In version 5.2.4 the file was created.

@arturcic arturcic self-assigned this May 12, 2020
@arturcic arturcic added this to the 5.3.x milestone May 12, 2020
arturcic added a commit to arturcic/GitVersion that referenced this issue May 12, 2020
@arturcic
Copy link
Member

Fixed by e92db5e

@arturcic arturcic modified the milestones: 5.3.x, 5.3.3 May 12, 2020
@github-actions
Copy link

🎉 This issue has been resolved in version 5.3.3 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

@hana26
Copy link

hana26 commented Jun 5, 2020

@arturcic I'm still facing this issue. I'm doing /updateassemblyinfo CommonAssemblyInfo.cs. However, this seems to be updating all the AssemblyInfo.cs files in my repository which is not what I want. I need to update only CommonAssemblyInfo.cs in one of the projects from the entire repository. How do I provide the path to that?

When I did /updateassemblyinfo /projectname/CommonAssemblyInfo.cs, it gave me this error: "Unhandled exception. GitVersion.WarningException: Could not parse command line parameter '/projectname/CommonAssemblyInfo.cs'"

@hana26
Copy link

hana26 commented Jun 5, 2020

^nvm, I was able to solve it by doing /updateassemblyinfo \projectname\CommonAssemblyInfo.cs

Turns out it was updating all the AssemblyInfo.cs files if it couldn't find the file you specified or something wrong with the path.

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

3 participants