Not sure if this is a duplicate or reported elsewhere or not. I’ve already got a support case going but wanted to get this more visibility. Case number is 996937.
When you compile in VS or look at the “problems” log in VS Code, you get “Type X exists in both System.Core and netstandard errors” and “call is ambiguous between” errors, especially if you’re using certain Linq functions. I’ve tested this across 3 machines so far, 1 Macbook Pro and 2 workstation PCs, with similar results. Mono/IL2CPP mode doesn’t seem to affect this at all.
This issue happens with the latest Visual Studio 2017 Community and VS Code, I haven’t updated to the absolute latest VSTU or beta 7 from this morning, so I’ll check those later today/evening.
I have also tested a minimum reproduction case and replicated it in a much smaller project. For those interested, you can find it here.
Here are my findings, occurs with b5 and b6 (and I first noticed the issue with b4). I haven’t yet tested with b7, am downloading this as I write this email.
In Unity itself, there are none of these “type defined in both System.Core and netstandard” errors, the errors only exist with VS/VSCode intellisense and manually-triggered compliation in Visual Studio.
On two PCs (with latest VS2017/VSTU and VS Code) (work and home development workstations):
Visual Studio:
If I use netstandard 2.0 from a cold project open (by deleting the generated solution/project files) , there are more issues with critical types missing in from .NET itself.
To clear these errors, you must have Unity compile/generate files AT LEAST ONCE with regular .NET 4.6 support, then reload Visual Studio.
There are still errors resulting, but they’re specifically the “type exists in both” error.
Visual Studio Code:
Either with a cold open (regenerating solution/projects) or having compiled and generated files with .NET 4.6 support, the result is identical:
“The Type exists in both” and “The call is ambiguous between” errors occur due to the referencing of both System.Core and netstandard.
This is in the images VSCodeColdOpenRecreateSolutionsWithNetstandard2 and VSCodeWithPregeneratedNetstandard2Solutions, which show identical results.
On Mac OSX:
Visual Studio 2017 Mac:
With or without cold open, there is the same issue, illustrated in the following image. The type exists in both.
Visual Studio Code:
Same issue as on windows, as illustrated in the VSCodeMacOSXColdOpenRegenerateNetStandard2 image.
It’s really annoying NOISE, and messing with the assembly references manually in the csproj doesn’t seem to fix it.
And there’s no issue in the editor at all. All of the scripts compile, display, attach to GOs, and run their logic just fine.




