cake-build / cake-build/cake

GitVersion saves AssemblyInfo in wrong format

Open
#1,437 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

### What You Are Seeing?

Error while building .Net Core project after using GitVersion step

### What is Expected?

No error.

### What version of Cake are you using?

0.17.0

### Are you running on a 32 or 64 bit system?

64

### What environment are you running on? Windows? Linux? Mac?

Windows 10 x64

### Are you running on a CI Server? If so, which one?

Running on local development machine

### How Did You Get This To Happen? (Steps to Reproduce)

Use the "GitVersion" functionality with the setting "UpdateAssemblyInfo" set to "true"

Build the .Net core project afterwards. You get this error:

C:\Projects\myproject\src\myprojectfolder\Properties\AssemblyInfo.cs(1,1): error SA1412: Store files as UTF-8 with byte order mark

If I set "UpdateAssemblyInfo" to "false" the problem does not occur, but AssemblyInfo files are not updated.

Stack trace from Diagnostic:

An error occurred when executing task 'Build'.
Error: Cake.Core.CakeException: .NET Core CLI: Process returned an error (exit code 1).
at Cake.Core.Tooling.Tool`1.ProcessExitCode(Int32 exitCode)
at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction)
at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments)
at Cake.Common.Tools.DotNetCore.Build.DotNetCoreBuilder.Build(String project, DotNetCoreBuildSettings settings)
at Cake.Common.Tools.DotNetCore.DotNetCoreAliases.DotNetCoreBuild(ICakeContext context, String project, DotNetCoreBuildSettings settings)
at Submission#0.<.ctor>b__6()
at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass5_0.b__0(ICakeContext context)
at Cake.Core.ActionTask.Execute(ICakeContext context)
at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context)
at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report)
at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
at Cake.Scripting.BuildScriptHost.RunTarget(String target)
at Submission#0..ctor(Session session, Object& submissionResult)
at Submission#0.(Session session)
at Roslyn.Scripting.CommonScriptEngine.Execute[T](String code, String path, DiagnosticBag diagnostics, Session session, Boolean isInteractive)
at Roslyn.Scripting.Session.Execute(String code)
at Cake.Scripting.Roslyn.Stable.DefaultRoslynScriptSession.Execute(Script script)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the GitVersion flow with UpdateAssemblyInfo set to true, then inspect the generated Properties/AssemblyInfo.cs mentioned in the error. Verify how the file is written and run the .NET Core build that currently reports SA1412. Done means the updated AssemblyInfo.cs uses UTF-8 with a byte-order mark and the build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.