Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[iOS] Local device debug results in HotRestart related crash #20173

@mikernet

Description

@mikernet

Current behavior

When deploying to a local iOS device in Debug config, the following exception crashes the app when it is launched:

[0:] An error occurred: 'Could not load file or assembly 'Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.'. Callstack: '   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Xamarin.iOS.HotRestart.Application.ForceLoadingAssemblies(Type formsDelegate, String contentFolder)
   at Xamarin.iOS.HotRestart.Application.Run(String[] args, Action`1 loadFrameworkAction, Action killApplicationAction)'

Note that this still happens when MainWindow.UseStudio(); is commented out.

Expected behavior

Create a new project with iOS as a target. Run with debugging on a local iOS device.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

5.6.51, 5.6.54, 6.0.67

Affected platforms

iOS

IDE

VS2022

IDE version

17.13.5

Relevant plugins

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/vswinCategorizes an issue or PR as relevant to Visual Studio for Windowsblocked/vsCategorizes an issue as blocked by a Visual Studio problemdifficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIkind/bugSomething isn't workingplatform/ios 🍎Categorizes an issue or PR as relevant to the iOS platformproject/core-tools 🛠️Categorizes an issue or PR as relevant to core and tools

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions