AmmyUI
AmmyUI copied to clipboard
Failure to hot reload during debugging
Expected Behavior
Debugging a WPF application with Ammy should update the user interface when changes are made and saved.
Current Behavior
A save triggers an attempted update and the app repaints, but it repaints with the old UI (not with the newly saved changes). Stopping the project and starting again presents the new UI.
Steps to Reproduce
- Create empty solution and setup new project per WPF quickstart
- Start debugging
- Change text block text
- Save file
Code Sample
App.ammy
Application "WpfApp1.App" {
StartupUri: "MainWindow.g.xaml"
}
MainWindow.ammy
Window "WpfApp1.MainWindow" {
Grid {
TextBlock {
Text: "Hello World! v1"
}
}
}
Environment
Visual Studio 2017 15.5.7 .NET Framework 4.7.02556 Ammy.WPF v1.2.94 Windows 10 x64 1709
Observations
I get the following line in the Output window:
WpfApp1.exe' (CLR v4.0.30319: WpfApp1.exe): Loaded 'C:\path\to\project\WpfApp1\bin\Debug\AmmySidekick.dll'. Cannot find or open the PDB file.
and App.ammy.cs has an error on the line:
app.InitializeComponent();
that says:
Error CS1061 'App' does not contain a definition for 'InitializeComponent' and no extension method 'InitializeComponent' accepting a first argument of type 'App' could be found (are you missing a using directive or an assembly reference?)
Potential Solution
Downgrading to Ammy.WPF v.1.2.92 and then reinstalling v1.2.94 seems to fix the issue. Not sure why this may have fixed it.
Can you send me a sample project?
Thanks!
I created another project from scratch following the UWP and WPF quickstarts. Both start and contain the UI described at build time, but neither one is hot reloading. On most executions, the WPF app will flash on save and looks like it does a repaint, but the UI doesn't actually change to the new content. On some runs, there is no flash at all. The UWP app does nothing on save. I made sure to check both "Private" and "Public" on the Windows firewall when the dialog came up.
Oh, and I tried downgrading to 1.2.92 and re-upgrade to 1.2.94 in the project above with no luck, so it doesn't look like that was a consistent solution.
It works fine for me in the WPF project. Maybe you have a firewall blocking the communication between Visual Studio and the application?