'System' : a namespace with this name does not exist 'System' : a namespace with this name does not exist wpf wpf

'System' : a namespace with this name does not exist


Set Common Language RunTime Support to be "Common Language RunTime Support (/clr)" in 2 places in your project properties :

For Visual Studio before 2019:

  • Configuration Properties -> General
  • Configuration Properties -> C/C++ -> General

For Visual Studio 2019:

  • Configuration Properties -> Advanced -> C++/CLI Properties
  • Configuration Properties -> C/C++ -> General


It was not enough for me when I just changed "Common Language RunTime Support (/ clr)".

I had to create the project in VS which would be a dedicated project for CLR:enter image description here

If you cannot see this option, you should add it in the VS installer first:enter image description here