Page 1 of 1

... is not supported in a Windows Presentation Foundation (WPF) project

Posted: Mon Dec 03, 2018 4:19 am
by Andreas
Hi Folks,

I am receiving the message "... is not supported in a Windows Presentation Foundation (WPF) project" in VS 2017 designer. This happens for new projects as well as the sample show case. It works at the start for a while, but then (with no obvious trigger), the issue kicks in.
CSHTML5 version: 1.2.125.181115.

Thanks,
Andreas

Re: ... is not supported in a Windows Presentation Foundation (WPF) project

Posted: Mon Dec 03, 2018 4:34 am
by JS-Support @Userware
Hi,

Please double-check that:
- The "Build Action" of all your XAML files is "Content" instead of "Page". To see/change the "Build Action", just select a XAML file in the Solution Explorer and press F4 to see its properties.
- Your project does not any reference to "System" or other assemblies which name starts with "System.*"

Usually the first point fixes the issue. Please let us know if it doesn't.

Thanks.
Regards

Re: ... is not supported in a Windows Presentation Foundation (WPF) project

Posted: Mon Dec 03, 2018 5:23 am
by Andreas
Hi,

Thanks for the quick reply.
For my own project: no Build action was set to "Page", all the xaml files have the build action set to "Content" and no System.* reference is added. So this is not the root cause.
For your sample showcase project: most xaml files are set to "Page" instead of "Content". I haven't changed them as there are quite a lot and referring to my own project, I don't think this will fix it.

See attached screenshots from the project file.

Thanks,
Andreas

Re: ... is not supported in a Windows Presentation Foundation (WPF) project

Posted: Mon Dec 03, 2018 7:28 am
by JS-Support @Userware
Hi,

Thanks for the reply.

1. Does the project compile properly?

2. Does the error also appear if you close all the open tabs (ie. all the open documents) and rebuild?

Thanks.
Regards

Re: ... is not supported in a Windows Presentation Foundation (WPF) project

Posted: Mon Dec 03, 2018 7:52 am
by Andreas
Hi,

Yes, the project compiles properly.
I tried close all open tabs and recompiled and that seems to have solved it temporarily.
It seems to come back randomly. Say I have multiple xaml and cs files open, I'm working on some cs code and then switch to a xaml file, I receive the error. It's hard to reproduce as it seems random.
I will try and see if the closing of tabs and recompile workaround helps for now.

Thanks,
Andreas