Unhandled Exception: System.IO.PathTooLongException: The specified path, file name, or both are too

Warning: A secret was passed to "bat" using Groovy String interpolation, which is insecure.
		 Affected argument(s) used the following variable(s): [API_KEY]
		 See https://jenkins.io/redirect/groovy-string-interpolation for details.
C:\Jenkins\workspace\application-30thmay-pipeline_dev>"C:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarScanner\SonarScanner.MSBuild.exe" end /d:sonar.login="****" 
SonarScanner for MSBuild 5.5.3
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.

Unhandled Exception: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
   at SonarScanner.MSBuild.Common.ProjectInfoExtensions.<>c.<GetAllAnalysisFiles>b__8_0(String path)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at SonarScanner.MSBuild.Shim.PropertiesFileGenerator.ToProjectData(IGrouping`2 projectsGroupedByGuid)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at SonarScanner.MSBuild.Shim.PropertiesFileGenerator.TryWriteProperties(PropertiesWriter writer, IEnumerable`1& allProjects)
   at SonarScanner.MSBuild.Shim.PropertiesFileGenerator.GenerateFile()
   at SonarScanner.MSBuild.PostProcessor.MSBuildPostProcessor.GenerateAndValidatePropertiesFile(AnalysisConfig config)
   at SonarScanner.MSBuild.PostProcessor.MSBuildPostProcessor.Execute(String[] args, AnalysisConfig config, ITeamBuildSettings settings)
   at SonarScanner.MSBuild.BootstrapperClass.PostProcess()
   at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SonarScanner.MSBuild.Program.<Main>(String[] args)
[Pipeline] }

Hey there.

In this community, we really expect more than just a stacktrace posted when you raise a topic, such as the information requested in the template post when you raise a new topic.

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

I would suggest trying the latest version of the Scanner for .NET, v5.7.1, as it adds additional support for long paths in windows

    • Enterprise Edition
  • Version 8.9.2
  1. Long path failure
  2. i will try 5.7.1 … currently using SonarScanner for MSBuild 5.5.3

Thanks … you are really awesome …

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.