maui: Hot Reload Problem : Read out of bounds

Description

I use Visual Studio 17.3. First time I used .NET MAUI BLAZORAPP yesterday and everythings worked well but today I get some errors.

Steps to Reproduce

  1. Create a File -> New .NET MAUI BLAZOR APP
  2. Added one page, added some blazor code in page and edited NavMenu for page
  3. Hot Reload worked for step two
  4. After one day, I Opened project again
  5. I got an error ‘You can’t started components bane with lowercase characters’ two same error
  6. Ex. test.razor, I changed components to Test.razor, one error gone one still here
  7. I deleted Test.razor file from pages folder and added new one called Testing.razor and edited NavMenu
  8. Projects work, I changed some codes on Testing.razor and clicked on Hot Reload button
  9. Hot Reload not worked, nothing changed and i don’t get any error
  10. I restarted Visual Studio and tested Hot Reload again but I get an error ‘Severity Code Description Project File Line Suppression State Error ENC1002 Cannot apply changes – unexpected error: ‘Read out of bounds.’ 1 Active’
  11. I restarted my computer and tried again but still get same error.

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

No response

Relevant log output

Severity	Code	Description	Project	File	Line	Suppression State
Error	ENC1002	Cannot apply changes -- unexpected error: 'Read out of bounds.'			1	Active

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Got same error with a .NET 7 MAUI Blazor App. Microsoft Visual Studio Community 2022 (64-bit) 17.6.0.

Error List: Error ENC1002 Cannot apply changes – unexpected error: ‘Read out of bounds.’ 1 Active’ Hot reload output: Invalid changes were found. Please refer to the Error List window to fix those issues.

Hot reload started to work again after a clean build (Build > Clean ProjectName).

Thanks @sezercik.

Error ENC1002 Cannot apply changes – unexpected error: ‘Read out of bounds.’ 1 Active’

@tmat is this potentially a known issue?

Problem still exists on 24.10.2023 at the latest VS 17.7.5 version

Only cleaning build forces it to dissapear