You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a pre-build event to update the project files on a new C# project using the /updateprojectfiles flag. On build, GitVersion was running and outputting json to the console, but the .csproj files were not getting modified. Adding -diag or /verbosity Diagnostic did not give any additional output other than the json containing the generated variables. When I compared the project file to one that was working, it had some additional elements, so I removed those and re-ordered the remaining ones to match. This fixed the issue and the files are now updating correctly. Additionally, the -diag option is now working as expected, but /verbosity Diagnostic still gives no additional output.
What is expected?
If there is a problem with the project file, GitVersion should output an error message.
On further investigation, the problem appears to be due to the <GenerateAssemblyInfo>False</GenerateAssemblyInfo> element. While I can understand this, it was not obvious initially from the GitVersion Command Line docs, and since the MSBuild documentation centers around using the package attributes to generate the AssemblyInfo.cs file. Perhaps a warning would be appropriate when this setting conflicts with the /updateprojectfiles flag?
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
5.12.0+Branch.support-5.x.Sha.3f75764963eb3d7956dcd5a40488c074dd9faf9e
Operating system
Windows
What are you seeing?
I added a pre-build event to update the project files on a new C# project using the
/updateprojectfiles
flag. On build, GitVersion was running and outputting json to the console, but the .csproj files were not getting modified. Adding-diag
or/verbosity Diagnostic
did not give any additional output other than the json containing the generated variables. When I compared the project file to one that was working, it had some additional elements, so I removed those and re-ordered the remaining ones to match. This fixed the issue and the files are now updating correctly. Additionally, the-diag
option is now working as expected, but/verbosity Diagnostic
still gives no additional output.What is expected?
If there is a problem with the project file, GitVersion should output an error message.
Steps to Reproduce
Original .csproj (partial):
Modified .csproj:
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
The text was updated successfully, but these errors were encountered: