Search code examples
c#using

Cannot import System.Windows.Window Class in a console application C#?


just like i said in the title, i am unable to use the Window class in my c# console application in visual studio.


Solution

  • Apart from reference to System.Windows assembly you also need to add references to PresentationCore, PresentationFramework and if you want to use xaml then System.Xaml.

    Most likely you will also need reference to WindowsBase assembly.