加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Sonar未分析的某些文件“文件中遇到无效字符”

发布时间:2020-12-15 20:56:38 所属栏目:百科 来源:网络整理
导读:我有几个文件未通过以下消息进行分析: Invalid character encountered in file [file name with full path] at line 9 for encoding UTF-8. Please fix file content or configure the encoding to be used using property ‘sonar.sourceEncoding’. 在Vis
我有几个文件未通过以下消息进行分析:

Invalid character encountered in file [file name with full path] at
line 9 for encoding UTF-8. Please fix file content or configure the
encoding to be used using property ‘sonar.sourceEncoding’.

在Visual Studio中,当我选择文件/高级保存选项时,文件被设置为西欧(Windows) – 代码页1252.

我将其更改为Unicode(带签名的UTF-8) – 代码页65001.

但SonarQube仍抱怨无效字符. “无效字符”是带有变音字符的德语注释(?,?,ü)

我该怎么做才能解决这个问题(不删除评论)?

解决方法

用于MSBuild的SonarQube扫描仪和SonarQube C#插件目前期望项目的所有文件都具有UTF-8编码 – 这是硬编码的.

在将来的版本中有一张改进此功能的票:https://jira.sonarsource.com/browse/SONARMSBRU-174

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读