Wpf Intellisense with VS2019

Apologies if I’m missing something obvious.

I just start using wpf rather than WinForms and when I’m in the xaml window, I get no intellisense when typing any < codes.

Thanks,

Joe

Tool: Visual Studio, Visual Studio Code, PSScriptPad, PowerShell Module
Version: 2021.12.2

It looks like you will need to make sure the references are correct for the project. When I added mscorlib and PresentationFramework to the PowerShell Project, it started to work for me.

1 Like

Thanks Adam…

PresentationFramework is added automatically when I create the PS Solution and add the WPF, but I had to add the mscorelib reference and I do get intellisense, but now I get an error that Window does not support direct content.

image

I found a post that I needed to add a reference to system.xaml. And when I did that, I get a different error.

image

Apologies for the gaps in my knowledge… Just starting to play with WPF.

Thanks,

Joe

No worries. This shouldn’t be your problem to solve. The extension should add these references properly. Let me investigate a bit to see which other assembly reference may be missing.

I added a few more references and now I have no squiggles and my IntelliSense works:

image

Worked like a charm!!!

Thanks Adam!

On a side note… That fixes VS2022!!!

Awesome! I’ll make sure we get a fix in for this for 2022.1.0!