inspectcode.exe: "Cannot resolve symbol" errors without clean build beforehand

This is pretty much a duplicate of this issue and other issues reported for non-standard build configurations. However, I have different versions and none of the suggested fixes worked for me.

 

We have a asp.net core project (with the new csproj type, i.e. with <Project Sdk="Microsoft.NET.Sdk">). I'm building that in our TeamCity CI using 'dotnet publish' ( not 'dotnet build'). I place the outputs of that build in a /buildoutput/ folder somewhere. 

In this configuration, the R# code inspections find countless build errors like "Cannot resolve symbol 'System'".

I noticed that this issue goes away when I do a clean 'dotnet build' of the solution before inspectcode is called.

 

I wasted too much time with this already, so I'm not going to analyze it any further. But it would be great if someone from the R# CLI team could look into this. I assume one can reproduce the problem by creating a new Asp.Net Core project (WebAPI type) and running only a 'dotnet publish' build (i.e. with a clean workspace that was never build with "dotnet build").

 

Furthermore, I simply wanted to note this information as it may be useful to someone in the future with the same issue. ;)

4
2 comments

we have a similar issue with .netstandard 20 build. while .netcore works fine, we get this cant resolve errors in solution that build .netstandard libs

0
Avatar
Permanently deleted user

In my case specifying "--dotnetcoresdk=%version%" in Additional InspectCode parameters helped.

0

Please sign in to leave a comment.