c# – Visual Studio Error CS0433: The type exists in both… (Unity-Accord.net)


It’s possible this is related to: Where does error CS0433 “Type ‘X’ already exists in both A.dll and B.dll ” come from?

In summary:
This can sometimes happen when Visual Studio fails to correctly clear out cached state as part of rebuilding. I have noticed it occurring more frequently with recent updates of VS2019.

Try the following steps and see if it helps:

  1. Delete all bin/obj directories for your solution using File Explorer
  2. Close VisualStudio and restart PC (this seems odd and unnecessary, but have found it can help)
  3. Reopen VisualStudio and do a full rebuild

It is also possible, although much more unlikely, that you genuinely have two references to the same package / dll with different hint paths. One retrieving a signed version, and one not (although if this is an external package it seems unlikely you’d have an unsigned version available). If the above steps don’t work, check your project file for duplicate references.

Leave a Reply

Your email address will not be published. Required fields are marked *