I am creating a VR project and I am trying to create a custom StyleCop rule for this. I created this class where I defined the rule and it needs some packages like: Microsoft.CodeAnalysis.CSharp and System.Collections.Immutable
When I import these in Visual Studio Code 2022, it works. There are no errors anymore. However, if I then open Unity it says that the errors are still there and when I reopen VS Code 2022, the errors appear while the packages are still in the packages.config and in the NuGet packages.
What am I missing here? Do I need to import them as well in Unity or …?
… did they slip into year-based product naming without me knowing?
I believe you’re referring to “Visual Studio 2022”
Treat the code editor as just that, a code editor. Also a debugger if you’re feeling spicy. Unity does its own thing with respect to compilation and setting up packages, you need to set things up via Unity, possibly with a third party NuGet support package.
Identify the necessary NuGet packages and the versions required (up to you to determine this). Then, your options are either downloading the nupkg for that version and extracting the .NET Standard 2.0 or .NET Standard 2.1 DLLs to your project, using a NuGet integration package like NuGetForUnity to manage them for you, or using UnityNuGet if the packages in question are supported.