Fresa;18574 wrote:I'm pretty sure this happens when building source generators that are missing transient dependencies which Roslyn doesn't load automatically.
The "worst" part is that NCrunch seems to solve this for Roslyn, creating false positives. This "error" is the only thing hinting that something is not right. I'd like to see NCrunch fail when reporting this error, is there a configuration option for that perhaps?
More background:
https://github.com/dotnet/sdk/issues/17775 I'm not sure entirely which issue you've been hit with under the hood, but the above warning is quite narrow in its scope and I don't see a way for it to relate to false positives from the build system.
When NCrunch first starts, it has a list of packages that it needs to have installed on your machine for NCrunch to work correctly. This list of packages is actually hard-coded into NCrunch (or at least, it's derived by the NCrunch build system when the installers are built). It's basically a list of a number of platform dependencies that NCrunch and its adapters need internally to be able to run without errors. In theory, it would be possible to just roll these dependencies into the NCrunch installer and install them with the rest of the proprietary binaries. We don't do this because it bloats the installer, and in almost all cases these dependencies are already installed on the user's machine.
The error is a warning because at the point the package restore fails, we don't actually know 100% whether the package is required by NCrunch's internal code. This is because platform resolution logic is extremely complex and changes between versions of the platform, and there's a high chance that the likely older binary being referenced by NCrunch has a newer version already installed on the machine which can resolve without problems. Some of the packages are also used by niche adapters that might not be needed to crunch your code (i.e. they might be for a test framework or toolset you're not using).
If you see this warning and your code runs fine under NCrunch, then there's actually no action required unless you want to get rid of the warning. If the warning shows and something fails, then restoring the packages is the first thing you should do.
I suspect the issue you've encountered with transient dependencies is unrelated to the above. Most likely this is caused by NCrunch's runtime resolution overrides that are needed to allow dependencies to be properly found by code running in its workspaces, in which case it will sadly be hard for us to replicate the exact behaviour you're experiencing inside the IDE. We try to keep the build results consistent between NCrunch and the IDE, but there are fundamental differences that can't be designed around.