InspectCode - Specify only one solution file
Hi,
I'm trying to run InspectCode on this repo from a powershell script that looks like this:
```
dotnet new tool-manifest
dotnet tool install JetBrains.ReSharper.GlobalTools
dotnet jb inspectcode --swea -it --output="./reports/Wyam2.jb.resharper.xml" --verbosity=VERBOSE Wyam.sln
dotnet jb dupfinder --output="./reports/Wyam2.jb.dupfinder.xml" --show-text Wyam.sln
```
The inspectcode always fails with "Specify only one solution file". DupFinder is succesful.
The full message returned by inspectcode:
```
JetBrains Inspect Code 2021.1.5
Running on AMD 64 in 32-bit mode, .NET runtime 3.1.17 under Microsoft Windows NT 10.0.19042.0
Specify only one solution file
Usage: inspectcode [options] [solution or project file]
Show help: inspectcode --help
```
Please advice.
Thank you.
Please sign in to leave a comment.
Hello Simona, thanks for the report.
Unfortunately, I was unable to reproduce the issue as described thus far. I am getting another error - "Solution file should not be specified for issues types dumping", which is the expected behavior.
I use the following command:
dotnet jb inspectcode --swea --it --output="./reports/Wyam2.jb.dupfinder.xml" --verbosity=VERBOSE Wyam.sln
JetBrains Inspect Code 2021.1.5
Running on AMD 64 in 64-bit mode, .NET runtime 3.1.17 under Microsoft Windows NT 10.0.19041.0
Solution file should not be specified for issues types dumping
Is there a chance you are getting "Specify only one solution file" error when -it option is not specified in the command?
How do you specify the path to the .sln file? Exactly as shown - Wyam.sln? Have you tried putting quotation marks around it? Have you tried specifying the full path to the output?
I get the same error, but only with the .Net tools version.
I did try this:
Which resulted in this:
Interestingly this happens when I call it without any path to a solution:
Output:
So the tool already gets some path injected even when no path was provided.
When I use the inspectcode.exe directly, everything works as expected.
Even the call without a provided solution file gives me the expected response:
Hi Jonas,
Great finding. It looks like the given parameters are not passed correctly from dotnet to inspectcode.
I'll look into it later today.
Hello Simona @...
Thank you for your findings! Do you observe the behavior using the PowerShell only? Could you check if the issue persists when running the latest 2021.2.1 build?
Hello Andrey Simukov
I updated to the latest build but the behavior is the same:
Powershell:
Windows cmd:
Git bash (MINGW64):
And without any provided solution file (with latest .Net runtime):
Hi @..., Simona
Is there any chance that the current user's folder has a space in his home folder? E.g.
C:\Users\space user\Hi,
yes mine has a space: C:\Users\Jonas Meer\
Hi Andrey Simukov
That's an Yes for me
```
echo %userprofile%
C:\Users\Simona Avornicesei
```
but the source code and the script are executed from another folder, that has no space in its path.
@..., Simona,
This is a known bug which should be fixed by the upcoming 2021.3 release: https://youtrack.jetbrains.com/issue/RSRP-485105 You're welcome to try the preview version once the 2021.3 EAP program is opened https://www.jetbrains.com/resharper/nextversion/
Thanks Andrey Simukov, I'm looking forward for the next release.
Meanwhile we'll keep battling with spaces and unicode chars in paths :D