简体   繁体   中英

Visual Studio - Azure DevOps encoding mismatch

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?

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

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM