Inspectcode.exe fails nuget restore

Background

I am using the (free) Resharper command line tools to inspect some code in a solution as part of our automated builds.
The automated build is invoked by TeamCity and executed on a build agent.
I setup version 2018.1.3 of the tools.

Problem

The following is output when I invoke Inspectcode.exe:

[15:53:38]C:\buildAgent\work\2357ecad7706ed4a\skt\build\tools\JetBrains.ReSharper.CommandLineTools.2018.1.3\inspectcode.exe --output:sketch.resharper.xml --properties:Configuration=Debug;Platform=AnyCpu sketch.sln

[15:53:38]JetBrains Inspect Code 2018.1.3
[15:53:38]Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.2.9200.0
[15:53:57]Package JetBrains.Annotations, version 11.0.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. at (208:5)
[15:53:57]Package JetBrains.Annotations, version 11.0.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. at (208:5)
[15:53:57]Can't resolve reference System: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Data: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Drawing: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Xml: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Core: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Runtime.Serialization: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Xml.Linq: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Numerics: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.IO.Compression.FileSystem: Reference wasn't resolved by MsBuild

Analysis

We never have nuget restore failures, In fact I run nuget restore immediately before this step, and it always succeeds. The nuget packages get pulled down and the *.csproj files know exactly where to look for them. This has never been an issue with our builds. It's inspectcode.exe that is passing false parameters to nuget that is causing the problem. 

I would like to know how to fix this, as it's holding up our entire automation goals.

Full Log

Here is the full log:

-----------------------------------------------------------------------------------------------------

[15:53:31]C:\buildAgent\work\2357ecad7706ed4a\skt\build\tools\bin\Nuget restore Sketch.sln -configFile Nuget.Config
[15:53:32]MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
[15:53:34]Restoring NuGet package iTextSharp-LGPL.4.1.6.
[15:53:34]Restoring NuGet package Newtonsoft.Json.11.0.2.
[15:53:34]Restoring NuGet package SolutionBuilder.1.0.3.
[15:53:34]Restoring NuGet package JetBrains.Annotations.11.0.0.
[15:53:34]Adding package 'Newtonsoft.Json.11.0.2' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:34]Adding package 'JetBrains.Annotations.11.0.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:34]Adding package 'iTextSharp-LGPL.4.1.6' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:34]Adding package 'SolutionBuilder.1.0.3' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:34]Added package 'JetBrains.Annotations.11.0.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:34]Added package 'iTextSharp-LGPL.4.1.6' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:35]Added package 'SolutionBuilder.1.0.3' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:35]Added package 'Newtonsoft.Json.11.0.2' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:35]Restoring packages for C:\buildAgent\work\2357ecad7706ed4a\skt\CoreEnumerations\Sketch.CoreEnumerations.csproj...
[15:53:35]Restoring packages for C:\buildAgent\work\2357ecad7706ed4a\skt\CoreInterface\Sketch.CoreInterface.csproj...
[15:53:35]Committing restore...
[15:53:35]Committing restore...
[15:53:35]Generating MSBuild file C:\buildAgent\work\2357ecad7706ed4a\skt\CoreEnumerations\obj\Sketch.CoreEnumerations.csproj.nuget.g.props.
[15:53:35]Generating MSBuild file C:\buildAgent\work\2357ecad7706ed4a\skt\CoreInterface\obj\Sketch.CoreInterface.csproj.nuget.g.props.
[15:53:35]Generating MSBuild file C:\buildAgent\work\2357ecad7706ed4a\skt\CoreEnumerations\obj\Sketch.CoreEnumerations.csproj.nuget.g.targets.
[15:53:35]Generating MSBuild file C:\buildAgent\work\2357ecad7706ed4a\skt\CoreInterface\obj\Sketch.CoreInterface.csproj.nuget.g.targets.
[15:53:35]Writing lock file to disk. Path: C:\buildAgent\work\2357ecad7706ed4a\skt\CoreEnumerations\obj\project.assets.json
[15:53:35]Writing lock file to disk. Path: C:\buildAgent\work\2357ecad7706ed4a\skt\CoreInterface\obj\project.assets.json
[15:53:35]Restore completed in 534.3 ms for C:\buildAgent\work\2357ecad7706ed4a\skt\CoreEnumerations\Sketch.CoreEnumerations.csproj.
[15:53:35]Restore completed in 533.77 ms for C:\buildAgent\work\2357ecad7706ed4a\skt\CoreInterface\Sketch.CoreInterface.csproj.
[15:53:35]
[15:53:35]NuGet Config files used:
[15:53:35] C:\buildAgent\work\2357ecad7706ed4a\skt\Nuget.Config
[15:53:35]
[15:53:35]Feeds used:
[15:53:35] C:\Windows\system32\config\systemprofile\.nuget\packages\
[15:53:35] https://api.nuget.org/v3/index.json
[15:53:35] https://proget.companyname.com/nuget/xm8-nuget/
[15:53:35] https://proget.companyname.com/nuget/sketch/
[15:53:35]
[15:53:35]Installed:
[15:53:35] 4 package(s) to packages.config projects
[15:53:35]C:\buildAgent\work\2357ecad7706ed4a\skt\build\tools\bin\Nuget restore Scriptor.sln -configFile Nuget.Config
[15:53:36]MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
[15:53:38]Restoring NuGet package System.IO.Compression.4.3.0.
[15:53:38]Restoring NuGet package System.IO.Compression.ZipFile.4.3.0.
[15:53:38]Adding package 'System.IO.Compression.4.3.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:38]Adding package 'System.IO.Compression.ZipFile.4.3.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:38]Added package 'System.IO.Compression.ZipFile.4.3.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:38]Added package 'System.IO.Compression.4.3.0' to folder 'C:\buildAgent\work\2357ecad7706ed4a\skt\packages'
[15:53:38]
[15:53:38]NuGet Config files used:
[15:53:38] C:\buildAgent\work\2357ecad7706ed4a\skt\Scriptor\Nuget.Config
[15:53:38]
[15:53:38]Feeds used:
[15:53:38] C:\Windows\system32\config\systemprofile\.nuget\packages\
[15:53:38] https://api.nuget.org/v3/index.json
[15:53:38] https://proget.companyname.com/nuget/xm8-nuget/
[15:53:38] https://proget.companyname.com/nuget/sketch/
[15:53:38]
[15:53:38]Installed:
[15:53:38] 2 package(s) to packages.config projects
[15:53:38]C:\buildAgent\work\2357ecad7706ed4a\skt\build\tools\JetBrains.ReSharper.CommandLineTools.2018.1.3\inspectcode.exe --output:sketch.resharper.xml --properties:Configuration=Debug;Platform=AnyCpu sketch.sln
[15:53:38]JetBrains Inspect Code 2018.1.3
[15:53:38]Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.2.9200.0
[15:53:57]Package JetBrains.Annotations, version 11.0.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. at (208:5)
[15:53:57]Package JetBrains.Annotations, version 11.0.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. at (208:5)
[15:53:57]Can't resolve reference System: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Data: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Drawing: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Xml: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Core: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Runtime.Serialization: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Xml.Linq: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.Numerics: Reference wasn't resolved by MsBuild
[15:53:57]Can't resolve reference System.IO.Compression.FileSystem: Reference wasn't resolved by MsBuild

 

2 comments

I even tried this with the TeamCity built in plugin and it failed with the same error.

0

@Christopher, I am afraid, we need a repro case. Your solution/project. We can sign NDA.

0

Please sign in to leave a comment.