question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
drasticactionscommented, Jun 30, 2022

@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.

0reactions
brminnickcommented, Jul 15, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

visual studio edit and continue does not work
On Visual studios' menu go on Tools>>options - Select "IntelliTrace" tab and let IntelliTrace events only checked.. Save, restart the visual ...
Read more >
Visual Studio 17.2.6 Breaks CommunityToolkit.Mvvm #6792
I uninstalled VS 17.2.6 and installed 17.2.5 that used to work. It doesn't anymore :-( Still the same error.
Read more >
VS 2022: Edit and continue isn't working.
Since recently upgrading to VS 2022, I cannot edit when in debug/break without being prompted: Edits were made which cannot be compiled.
Read more >
Edit and Continue warns about changes that cannot be ...
Have a solution with multiple projects. When debugging and stopping at a breakpoint, it wont start again (F5, F11, F10) but instead complains...
Read more >
Edit & Continue Debugging Not Working in VS2022 : r/csharp
I have VS2019 and 2022 installed side-by-side. In my winforms project, ... When I load the same project in VS22 it pops up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found