Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Using XAML HotReload breaks compilation targeting Android #1247

Closed
albyrock87 opened this issue Jun 27, 2024 · 2 comments
Closed

[BUG] Using XAML HotReload breaks compilation targeting Android #1247

albyrock87 opened this issue Jun 27, 2024 · 2 comments
Assignees
Labels
area-hotreload Issues with Hot Reload experiences area-maui bug Something isn't working triaged The issue has been triaged vs-sync Add this label to synchronize the issue to AzDo vs-syncd Linked to AzDO

Comments

@albyrock87
Copy link

albyrock87 commented Jun 27, 2024

Describe the Issue

I'm trying to contribute to the MAUI project https://github.com/dotnet/maui this commit
While targeting and android device or emulator and pressing F5 to debug this project I get a compilation error.

/Users/<myuser>/github/maui/src/Core/src/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(24,40): error CS0436: The type 'HotReloadMobileTapInitializer' in 'Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs' conflicts with the imported type 'HotReloadMobileTapInitializer' in 'Microsoft.Maui.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs'. [/Users/<myuser>/github/maui/src/Core/src/Core.csproj::TargetFramework=net8.0-android]

Notes:

  • I followed the following steps to make sure solution is clean and ready
  • Disabling XAML HotReload lets me compile without issues
git clean -xdf
dotnet tool restore && dotnet build ./Microsoft.Maui.BuildTasks.slnf

Steps To Reproduce

No response

Expected Behavior

Android application should compile and start with HotReload working.

Environment Information

NET MAUI 1.1.14 (pre-release)
C# 2.35.15 (pre-release)
C# DevKit v1.8.10 (pre-release)
=> stable channel releases have the same issue

dotnet 8.0.201

VSCode 1.90
MacOS Sonoma 14.2.1 (Processor M3)
| VS Bug 2113775

@albyrock87 albyrock87 added the bug Something isn't working label Jun 27, 2024
@BretJohnson BretJohnson self-assigned this Jun 27, 2024
@BretJohnson BretJohnson added area-maui area-hotreload Issues with Hot Reload experiences vs-sync Add this label to synchronize the issue to AzDo labels Jun 27, 2024
@AllenD-MSFT AllenD-MSFT added the vs-syncd Linked to AzDO label Jul 3, 2024
@emaf emaf added the triaged The issue has been triaged label Jul 15, 2024
@MartyIX
Copy link

MartyIX commented Jul 17, 2024

I attempted to run Maui.Controls.Sample project in VS Code on macOS and I get:

/Users/USER/maui/src/Controls/samples/Controls.Sample/Microsoft.VisualStudio.HotReload.MobileTapInitializer/Microsoft.VisualStudio.HotReload.MobileTapInitializer.ModuleInitializerGenerator/HotReloadMobileTapInitializer.g.cs(65,15): error CS0246: The type or namespace name 'Exception' could not be found (are you missing a using directive or an assembly reference?) [/Users/USER/maui/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj::TargetFramework=net8.0-maccatalyst]

@BretJohnson
Copy link
Member

This should be fixed now, in C# extension 2.39 and later, now published to prerelease.
If after updating the C# extension (and MAUI DevKit and C# DevKit extensions) to the latest prerelease you still see this problem, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hotreload Issues with Hot Reload experiences area-maui bug Something isn't working triaged The issue has been triaged vs-sync Add this label to synchronize the issue to AzDo vs-syncd Linked to AzDO
Projects
None yet
Development

No branches or pull requests

5 participants