CLT - Invalid static method invocation syntax - GetParent not found
Hello,
I am experiencing an odd error on my build server (Windows Server 2012) when running inspectcode .
I do not experience these errors when I run it locally.
FWIW; it's a .NET Core project.
JetBrains Inspect Code 2017.2.2 Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.2.9200.0
Custom settings layer is mounted. Used file *\.DotSettings
Invalid static method invocation syntax: "[System.IO.Directory]::GetParent().get_Name()". Method 'System.IO.Directory.GetParent' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). at (529:9) Invalid static method invocation syntax: "[System.IO.Directory]::GetParent().get_Name()". Method 'System.IO.Directory.GetParent' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). at (529:9)
Analyzing files
Analyzing *.csproj Analyzing *.AssemblyInfo.cs .
..
...
Inspecting *.cs
.
..
...
Inspection report was written to *\Results.xml
Please sign in to leave a comment.
Hello!
Thank you for contacting us.
Could you please check that there's no specific symbols in the folders name (like commas etc)? Here's similar case - https://stackoverflow.com/questions/25594422/nuget-issues-updating-a-package-breaks-build
Thank you.
Hi @Angelina,
I have verified that the only symbols used in my project on the build server (and locally) are alpha-numeric, or periods.
Another piece of information, probably related, the inspectcode command, when run locally, returns no Issues with severity greater than "SUGGESTION". When run on the build server, there are significant issues reported, including compilation errors.
EDIT: Sorry for the delay, I was AFK for a couple days.
EDIT 2: I installed the tools into a folder that contains underscores '_', and added that folder to the PATH variable.
I have gotten it to a point where it succeeds on my local machine, and on the build server (in the Jenkins Workspace!) on which the Jenkins Slave runs.
However, it is still failing to succeed when running from a Jenkins Job. Same error as reported.
bump
Ted, I have only registered to try to help you because I faced an error like this.
My problem was that the Jenkins slave was using a Windows service and the user that was starting the service wasn't which I thought.
In log on tab, instead local system account I set a specific user.
Interesting.
FWIW it was fixed "automagically" for us by updating the box or jenkins version by our Jenkins slave admins.