<i id='pU6Jy'><tr id='pU6Jy'><dt id='pU6Jy'><q id='pU6Jy'><span id='pU6Jy'><b id='pU6Jy'><form id='pU6Jy'><ins id='pU6Jy'></ins><ul id='pU6Jy'></ul><sub id='pU6Jy'></sub></form><legend id='pU6Jy'></legend><bdo id='pU6Jy'><pre id='pU6Jy'><center id='pU6Jy'></center></pre></bdo></b><th id='pU6Jy'></th></span></q></dt></tr></i><div id='pU6Jy'><tfoot id='pU6Jy'></tfoot><dl id='pU6Jy'><fieldset id='pU6Jy'></fieldset></dl></div>
  • <tfoot id='pU6Jy'></tfoot>
      <bdo id='pU6Jy'></bdo><ul id='pU6Jy'></ul>
    1. <small id='pU6Jy'></small><noframes id='pU6Jy'>

        <legend id='pU6Jy'><style id='pU6Jy'><dir id='pU6Jy'><q id='pU6Jy'></q></dir></style></legend>

        SonarQube C# 分析失败“不是指针的有效行偏移"

        SonarQube C# Analysis Fails to #39;Not a Valid Line Offset for Pointer#39;(SonarQube C# 分析失败“不是指针的有效行偏移)
          <tfoot id='76cU5'></tfoot>

              <legend id='76cU5'><style id='76cU5'><dir id='76cU5'><q id='76cU5'></q></dir></style></legend>
                <tbody id='76cU5'></tbody>

                <bdo id='76cU5'></bdo><ul id='76cU5'></ul>
                • <small id='76cU5'></small><noframes id='76cU5'>

                  <i id='76cU5'><tr id='76cU5'><dt id='76cU5'><q id='76cU5'><span id='76cU5'><b id='76cU5'><form id='76cU5'><ins id='76cU5'></ins><ul id='76cU5'></ul><sub id='76cU5'></sub></form><legend id='76cU5'></legend><bdo id='76cU5'><pre id='76cU5'><center id='76cU5'></center></pre></bdo></b><th id='76cU5'></th></span></q></dt></tr></i><div id='76cU5'><tfoot id='76cU5'></tfoot><dl id='76cU5'><fieldset id='76cU5'></fieldset></dl></div>
                • 本文介绍了SonarQube C# 分析失败“不是指针的有效行偏移"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经使用 SonarQube 成功分析了一段时间的项目,但现在我遇到了一些错误.确切的错误是:

                  I have projects that I've been analysing with SonarQube succesfully for a while, but now I'm having some errors. The exact error is:

                  12:26:01.413 ERROR: Error during SonarQube Scanner execution
                  java.lang.IllegalArgumentException: 74 is not a valid line offset for pointer. File [blaablaablaa...] has 70 character(s) at line 118
                      at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
                      at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:252)
                      at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:186)
                      at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:202)
                      at org.sonarsource.dotnet.shared.plugins.AbstractSensor$SarifParserCallbackImplementation.onIssue(AbstractSensor.java:160)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.handleResultFileElement(SarifParser10.java:130)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.handleLocationsElement(SarifParser10.java:102)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.handleIssue(SarifParser10.java:73)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.handleIssues(SarifParser10.java:62)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.accept(SarifParser10.java:54)
                      at org.sonarsource.dotnet.shared.sarif.SarifParser10.accept(SarifParser10.java:37)
                      at org.sonar.plugins.csharp.CSharpSensor.importRoslynReport(CSharpSensor.java:188)
                      at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:123)
                      at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:79)
                      at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
                      at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
                      at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
                      at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
                      at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:175)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
                      at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:262)
                      at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
                      at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:255)
                      at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:247)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
                      at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
                      at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
                      at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
                      at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
                      at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
                      at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
                      at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                      at java.lang.reflect.Method.invoke(Unknown Source)
                  12:26:01.419 DEBUG: Execution getVersion
                  12:26:01.420 DEBUG: Execution stop
                      at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
                      at com.sun.proxy.$Proxy0.execute(Unknown Source)
                      at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
                      at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
                      at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
                      at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
                      at org.sonarsource.scanner.cli.Main.main(Main.java:61)
                  

                  我已将 C# 分析器更新到最新版本(已安装 5.10.1 (build 1411)).至少更新中心不提供更新的?

                  I have updated the C# analyzer to the latest (5.10.1 (build 1411) installed). At least the update center doesn't provide a newer?

                  我还将扫描仪更新为 sonar-scanner-msbuild-2.3.2.573

                  我正在使用 SQ 6.3.1.21392

                  在 SO 中有很多类似的帖子,但它们都很旧,他们认为这要么是分析器中的已知错误,要么是编码问题.我尝试将问题文件编码更改为纯 UTF-8,但这并不能解决问题.Notepad++ 显示编码为 UTF-8-BOM.我也使用了 bomremover,但这根本不会改变错误.

                  There are quite a few similar posts here in SO, but all of them are pretty old and they suggest that it's either a known bug in the analyzer or an encoding issue. I've tried to change the problem file encoding to plain UTF-8, but that doesn't resolve the issue. Notepad++ shows the encoding is UTF-8-BOM. I've also used the bomremover, but that doesn't change the error at all.

                  除了从分析中排除所有问题文件之外,还有什么建议可以尝试吗?

                  Any suggestions what to try except to exclude all the problem files from the analyse?

                  编辑
                  该文件的编码是 UTF-8-BOM,但将其转换为纯 UTF-8 没有区别.

                  EDIT
                  The encoding of the file is UTF-8-BOM, but it makes no difference to convert it to plain UTF-8.

                  我使用 Notepad++ 转换为 UTF-8 并重新运行分析.结果相同的错误,这是新编码的屏幕截图:

                  I used Notepad++ convert to UTF-8 and re-run the analysis. Same error as a result and here's a screenshot of the new encoding:

                  推荐答案

                  通过重新克隆 repo 并再次运行分析解决了该问题.问题的根本原因仍然未知.

                  The issue was resolved by re-cloning the repo and running the analysis again. The root cause of the problem remains unknown.

                  如果您遇到同样的问题,请尝试通过将 repo 克隆到其他位置或将文件内容复制粘贴到新创建的文件中来重新创建文件.

                  If you are having the same issue, try to re-create the file again by either cloning the repo to different location or by copy-paste the file contents inside newly created file.

                  这篇关于SonarQube C# 分析失败“不是指针的有效行偏移"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)

                  <small id='ar9Zz'></small><noframes id='ar9Zz'>

                • <legend id='ar9Zz'><style id='ar9Zz'><dir id='ar9Zz'><q id='ar9Zz'></q></dir></style></legend>
                    <tbody id='ar9Zz'></tbody>
                  • <i id='ar9Zz'><tr id='ar9Zz'><dt id='ar9Zz'><q id='ar9Zz'><span id='ar9Zz'><b id='ar9Zz'><form id='ar9Zz'><ins id='ar9Zz'></ins><ul id='ar9Zz'></ul><sub id='ar9Zz'></sub></form><legend id='ar9Zz'></legend><bdo id='ar9Zz'><pre id='ar9Zz'><center id='ar9Zz'></center></pre></bdo></b><th id='ar9Zz'></th></span></q></dt></tr></i><div id='ar9Zz'><tfoot id='ar9Zz'></tfoot><dl id='ar9Zz'><fieldset id='ar9Zz'></fieldset></dl></div>
                      <bdo id='ar9Zz'></bdo><ul id='ar9Zz'></ul>
                      <tfoot id='ar9Zz'></tfoot>