Cannot run ReSharper InspectCode Command Line Tool with Xamarin.Forms project

Hi. I have a Xamarin.Forms project targeting .NETPortable v4.5 (Profile 78). This solution was very painless to import into JetBrains Rider and builds out of the box. However, I cannot seem to get the InspectCode CLI (version: JetBrains.ReSharper.CommandLineTools.Unix.2019.3.1) to properly analyze the project, running on my MacOS (Catalina, 10.15.1) machine.

- Running "inspectcode.sh MySolution.sln --output=report.html --format=Html" produces errors such as "The imported project {AN INCORRECT PATH}/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets was not found." (same for Xamarin.iOS.CSharp.targets and Xamarin.Android.CSharp.targets, i.e. it doesn't seem to be able to resolve the ${MSBuildExtensionsPath} and ${MSBuildExtensionsPath32} references in the .csproj files). Thus it also says that the "Build" target was not found (since it exists in these .target files), and that a bunch of references cannot be resolved (including even System, System.Core, System.Net, but also nuget packages that are used in the projects). It then starts analyzing the files, but since it cannot resolve _anything_, the files contains thousands of issues.

- Looking in Rider Preferences->Build...->Toolset and Build, I can see the msbuild .dll it's using. Running "inspectcode.sh MySolution.sln --output=report.html --format=Html --toolset-path="THE_PATH_TO_MSBUILD_DLL"" it instead complains about "Read-only file system at (0:0)" and "Unable to create directory "/Debug/". Read-only file system at (31:3)", as well as "The result "" of evaluating the value "$(MicrosoftNETBuildExtensionsTasksAssembly)" of the "AssemblyFile" attribute in element <UsingTask> is not valid."

- In the Rider preferences there is also a custom reference to a mono executable, but adding "--mono="PATH_TO_MONO"" to the command above, it just spits out a bunch of exceptions and stacktraces and then quits.

Has anyone had success running InspectCode.sh with a Xamarin.Forms project, and may know what the issue is?

Thanks!

0

Please sign in to leave a comment.