The type 'Window' does not support direct content

At least in a WPF IronPython project, adding the System.Xaml reference to the project solved the problem for me:

enter image description here

An important thing to note here is that adding seemingly any reference will make the problem go away temporarily -- until Visual Studio is restarted. System.Xaml, on the other hand, appears to keep the problem at bay. I even tried removing the reference, whereafter the problem returned upon restarting Visual Studio.


Make sure you reference System.Xaml. Clean and rebuild the project. Works on VS 2015 Update 1.