Select to view content in your preferred language

XAML Designer for ProWindow missing after Visual Studio update

2617
8
Jump to solution
05-19-2023 12:49 PM
anonymous_geographer
Frequent Contributor

Hey everyone,

Just curious if anybody else is experiencing this issue too. Today, I upgraded Visual Studio 2022 to v17.6.0 (released May 16th). Now I can't get any new or existing projects to display the ProWindow XAML Designer for my add-ins, even after rebuilding the projects and rebooting the PC, the issue remains. It will only display the XAML code itself. The XAML Designer is working as expected for user controls and WPF windows, so it seems isolated to ProWindows.

If I build/rebuild the projects and test within ArcGIS Pro, the Pro Windows appear as expected. It's only missing from the XAML Designer in Visual Studio 2022.

I even attempted to create fresh, new projects and load in brand new ProWindow items, but I get the same behavior. Here's a ProWindow XAML example that I haven't manipulated, in case you see something amiss.

<controls:ProWindow x:Class="temp_TestingTheProAddIn.ProWindow2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:controls="clr-namespace:ArcGIS.Desktop.Framework.Controls;assembly=ArcGIS.Desktop.Framework"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
        mc:Ignorable="d"
        Title="ProWindow2" Height="300" Width="300"
        WindowStartupLocation="CenterOwner"
    >
    <controls:ProWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </controls:ProWindow.Resources>
    <Grid>

    </Grid>
</controls:ProWindow>



If it matters, I'm running Pro v3.1.1 with Pro SDK v3.1.0.41833.

Thanks

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Visual Studio 2022 Update 17.6.2 was available for me this morning.   I installed the patch, and the Designer View comes up as expected now for my sample WPF forms.  It looks like my patches version of  "Microsoft.VisualStudio.DesignTools.XamlDesignerHost.pkgdef" was overwritten by the update and the fix (see above) had been applied to the replacement file.

 

View solution in original post

8 Replies
anonymous_geographer
Frequent Contributor

Here's something interesting...I did some crazy tests and was able to trick the system into correcting itself.

I changed controls:ProWindow to ProWindow, then right clicked on the XAML file to View Designer. The Designer finally appears, but with "Invalid Markup" (as expected due to invalid code). 

anonymous_geographer_0-1684528966622.png

I then immediately modified the XAML code back to controls:ProWindow and poof! The XAML designer was displaying/working again as expected.

anonymous_geographer_1-1684529049377.png

Bizarre.

Wolf
by Esri Regular Contributor
Esri Regular Contributor

i just upgraded to VS 17.6.0 and i am also not able to get the XAML Design View to show up.  i only see the XAML source view.  So i tried your trick and sure enough your fix worked for me as well.  I then closed and reopened the project and poof! - your term 😉 - the Designer View still works.  However, i had a second ProWindow control in the same VS project that still didn't work.  I suppose i have apply your magic trick on that control as well.

If i close VS, then delete the bin and obj folders, and then reopen VS, the Designer View is broken again.  I have to apply your magic trick again.  

It appears that the XAML Design View works fine when i create a new .NET WPF application. 

I will look into this a bit more.

 

anonymous_geographer
Frequent Contributor

Thanks for checking, Wolf. I just upgrade to VS 17.6.1 (released today), and hoped that would resolve the issue. It did not.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I tried that as well.  Didn't work for me either.  i reported the issue on VS Community.  I am not holding my breath so:   Visual Studio 2022 Designer - Design View doesn't show for User Controls - Developer Community

 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

So apparently the issue has already been reported to Microsoft under a different title:

Syncfusion Controls like RibbonWindow and ChromelessWindows no longer rendering in designer preview ...

Here’s a way to try out the fix ahead of time at your own risk, although it’s pretty low risk and easy to undo. You need to be admin on the machine.

1. Find this file in your VS installation directory:
Common7\IDE\CommonExtensions\Microsoft\DesignTools\Microsoft.VisualStudio.DesignTools.XamlDesignerHost.pkgdef
2. Open that file in notepad++
3. Find this text in the file:
"Namespace"="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4. Duplicate that line right underneath and change Namespace to DefaultNamespace, so it’ll look like this:
"Namespace"="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
"DefaultNamespace"="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5. Save the file
6. From your VS installation directory, run (requires admin):
devenv.exe /setup
7. Give it a minute to finish

This actually worked for me.  Now when you open a XAML file it is actually treated as a XAML file and not as an XML file.

Microsoft promised a fix in a 'future' release.

anonymous_geographer
Frequent Contributor

I finally got a chance to try that workaround. It worked for me as well! I'll mark this as a solution while Microsoft sorts itself out.

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

update from MS:

A fix for this issue has been internally implemented and is being prepared for release. We’ll update you once it becomes available for download (should be in 17.6.2)

 

Wolf
by Esri Regular Contributor
Esri Regular Contributor

Visual Studio 2022 Update 17.6.2 was available for me this morning.   I installed the patch, and the Designer View comes up as expected now for my sample WPF forms.  It looks like my patches version of  "Microsoft.VisualStudio.DesignTools.XamlDesignerHost.pkgdef" was overwritten by the update and the fix (see above) had been applied to the replacement file.