Maui: [Bug] Edit And Continue doesn't work as soon as the CommunityToolkit is installed

Description

Edit And Continue doesn’t work as soon as the CommunityToolkit is installed

Stack Trace

N/A

Link to Reproduction Sample

N/A

Steps to Reproduce

  1. Open Visual Studio, create a new MauiApp.
  2. Hello World with “click me” button is created.
  3. Clicking the button increase the counter and the button text updates accordingly.
  4. Under MainPage.xaml.cs, change count++; to count+=2;
  5. Saving the page (Hot Reload on file save is checked) and clicking the button, the counter changes adding 2 every time as expected. 5b. stop the debug
  6. NuGet - Solution, install CommunityToolkit.Maui 1.0.0-rc3 readme.txt pops up and, under MauiProgram.cs add:
  7. using CommunityToolkit.Maui; as first row
  8.    // Initialise the toolkit
       builder.UseMauiApp<App>().UseMauiCommunityToolkit();
    

after var builder = MauiApp.CreateBuilder(); as requested

  1. The following new lines appear in .csproj file
<ItemGroup>
  <PackageReference Include="CommunityToolkit.Maui" Version="1.0.0-rc3" />
</ItemGroup>
  1. Debug -> Windows Machine…

  2. Repeat action 3 and 4

  3. Saving the page (Hot Reload on file save is checked) the following popup appears

Hot Reload
Hot Reload can't automatically apply your changes. The app needs to be rebuilt to apply updates
[...]
[Rebuild and Apply Changes] [Continue Editing]

Expected Behavior

Edit And Continue working

Actual Behavior

Edit And Continue not working

Basic Information

  • Version with issue: 1.0.0-rc3
  • Last known good version:
  • IDE: Visual Studio 2022 preview 17.3 Preview 1
  • Platform Target Frameworks:
    • windows
  • Nuget Packages:
    • Microsoft.Maui.Dependencies 6.0.300-rc.3.5667
    • Microsoft.Maui.Extensions 6.0.300-rc.3.5667
    • Microsoft.Windows.SDK.BuildTools 10.0.22000.194
    • System.Runtime.InteropSerivices.NFloat.Internal 6.01
    • CommunityToolkit (the only one added to the original solution)
  • Affected Devices:

Workaround

Removing the toolkit the issue disappears:

  • REMOVE using CommunityToolkit.Maui;
  • REMOVE
// Initialise the toolkit
      builder.UseMauiApp<App>().UseMauiCommunityToolkit();
  • AND REMOVE
<ItemGroup>
  <PackageReference Include="CommunityToolkit.Maui" Version="1.0.0-rc3" />
</ItemGroup>

Reproduction imagery

N/A

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18 (7 by maintainers)

Most upvoted comments

@cargnel (And those experiencing this) I would file this to VS Feedback (https://developercommunity.visualstudio.com/home)

The likelyhood of this being specific to this package is, as far as I can see, very slim. They are not doing anything different that would cause Hot Reload to break (Also note that EnC and C# Hot Reload are not exactly the same mechanics under the covers for different platforms and runtimes.). I don’t think this would ever get fixed in this repo, it needs to be looked at in Visual Studio.