0

Following line builds locally in Visual Studio

Assert.IsNotNull(login.Prihlásenie);

But in Azure DevOps build pipeline I'm getting error

Error CS1056: Unexpected character '¾'

I guess it is because of the different charset in my local Windows. Is is possible to force Visual Studio always save files with unicode encoding or whatever the build agent expects?

Liero
  • 25,216
  • 29
  • 151
  • 297

1 Answers1

0

First, make sure your local VS/MSBuild has the same version as Azure DevOps agent image. Then check case Error CS1056: Unexpected character '$' running the msbuild on a tfs continuous integration process, to see whether the solution installing a Nuget package Microsoft.Net.Compilers is working for you.

Last, you may save a file with encoding by following the documentation below:

https://learn.microsoft.com/en-us/visualstudio/ide/how-to-save-and-open-files-with-encoding?view=vs-2019

enter image description here

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39