CLT error: Can't find target solution file on path
According to the documentation for code inspection I should provide the relative path from the checkout directory to the solution to be analyzed but when I provide that path I get the error in the title. From the logs:
Checkout directory: C:\TeamCity\buildAgent\work\179486895e6f1b02
Starting: C:\TeamCity\buildAgent\tools\jetbrains.resharper-clt.2017.1.20170613.162720\tools\inspectcode.exe --config=C:\TeamCity\buildAgent\temp\agentTmp\dotnet-tools-inspectcode.config --swea
[11:53:58][Step 2/4] in directory: C:\TeamCity\buildAgent\work\179486895e6f1b02
Can't find target solution file on path C:\Internal\APIRefactor.sln <-- this path is not prefixed with the checkout directory.
So I'm wondering: did I configure the path incorrectly, was this a known bug in this version of the CLT (is there a working version of CLT that I can use until version 2017.2.1 comes out?) or something else?
Please sign in to leave a comment.
Hi Thomas
We don't create the path out of nowhere, if it wasn't set up for us, it would be automatically some directory tied to the work directory. Do you have that path set up somewhere? Do you have an inspection profile configured for the .net projects?
\Internal\APIRefactor.sln was the path that I provided for the solution to be inspected. I can see that the checkout directory is C:\TeamCity\buildAgent\work\179486895e6f1b02 so I was expecting the path C:\TeamCity\buildAgent\work\179486895e6f1b02\Internal\APIRefactor.sln. Instead the path that inspection used to look for the solution was C:\Internal\APIRefactor.sln. Everything else is set up properly as far as I can tell since when I prefixed the solution path with %teamcity.build.checkoutDir% inspection was run properly. However, according to information below the text box which says "Specified path should be relative to the checkout directory.", it sounds like it should be unnecessary to prefix the solution path with the environment variable %teamcity.build.checkoutDir%
Hi Thomas, and sorry for the delay,
I thought you only had the "APIRefactor.sln" as the path to the solution file, now that you mention the full path I can understand what is going on. The initial "\" usually indicates an absolute path, not a relative one, and TeamCity fails to handle it properly, giving it the "C:" on top of it. If you remove the "\", the proper path will be picked up. I managed to replicate the issue and have created the issue https://youtrack.jetbrains.com/issue/TW-51441 in our tracker to get it fixed.
This said, the "workaround" should be just to remove the initial "\" symbol, which should not have been added to a relative path in the first place.