31

I've just created a new WPF project in the blend, pushed it on git, added mqsql drivers, rest service and nfc sdk and suddenly blend tells me that Application is not supported. The error leads me to App.xaml which is entirely unedited and looks like this:

<Application x:Class="desktop_client.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:desktop_client"
         StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>

The same error goes for practically any tag such as Style, Setter, ControlTemplate, Canvas, Path. nothing is supported. comparing both the xaml and the c# file to the other project I just finished which works just fine, there is no difference (other than namespace and the path, naturally)

I'm absolutely dumbfounded

Ehsan
  • 767
  • 7
  • 18
user3106891
  • 437
  • 1
  • 4
  • 7

3 Answers3

74

Had same issue in VS. I closed and restarted VS and no longer got the error.

dvdhns
  • 3,026
  • 2
  • 15
  • 11
16

Try adding the following references:

  • PresentationCore
  • PresentationFramework
  • WindowsBase

With the ReferenceManager in your project. The above references are the references used by wpf.

MattFisch
  • 445
  • 4
  • 7
13

So old, still occurs - to save time for others - this is the solution that works in VS-2019, as @"Andreas Forslöw" wrote:

Even easier: Right click the project in Solution explorer, click "Unload project". Then, when unloaded, right click again and click "Reload project". Worked for me! – Andreas Forslöw

ShloEmi
  • 1,851
  • 2
  • 20
  • 25
  • 2
    In my case VS 2019 restart (top-voted answer from @dvdhns) and even win10 reboot didn't help, but this solution worked fine! – sarh Aug 25 '22 at 10:43