繁体   English   中英

Visual Studio - Azure DevOps 编码不匹配

[英]Visual Studio - Azure DevOps encoding mismatch

以下行在 Visual Studio 中本地构建

Assert.IsNotNull(login.Prihlásenie);

但是在 Azure DevOps 构建管道中我遇到了错误

错误 CS1056:意外字符“¾”

我想这是因为我本地 Windows 中的字符集不同。是否可以强制 Visual Studio 始终使用 unicode 编码或构建代理期望的任何内容保存文件?

首先,确保您的本地 VS/MSBuild 具有与 Azure DevOps 代理映像相同的版本。 然后检查 case Error CS1056: Unexpected character '$' running the msbuild on a tfs continuous integration process ,看看安装 Nuget package Microsoft.Net.Compilers 的解决方案是否适合你。

最后,您可以按照以下文档保存带有编码的文件:

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

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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