Search code examples
.net-6.0.net-maui

.NET Maui: I can not debug in iOS because of "Could not load file or assembly Xamarin.HotReload.Contracts.dll" message


when I try to debug my mobile application in iOS mobile I get the following error message that prevent lunching the application

  • It work fine in Android mobile (Debug & Deploy)
  • I can deploy the application to iOS mobile and it is running without any issue

the problem only when I try to debug in iOS mobile !!

    2022-09-21 22:36:48.986 Xamarin.PreBuilt.iOS[7534:887994] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/9E6C6404-A165-49B0-9748-DC6534494814/Documents/MyMobileApp.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.
    
    2022-09-21 22:36:48.990 Xamarin.PreBuilt.iOS[7534:887994] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/9E6C6404-A165-49B0-9748-DC6534494814/Documents/MyMobileApp.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.
    
    Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:419 [0x00000].
    **System.IO.FileNotFoundException:** 'Could not load file or assembly '/var/mobile/Containers/Data/Application/9E6C6404-A165-49B0-9748-DC6534494814/Documents/MyMobileApp.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.'
    
    The app has been terminated.

Solution

  • the issue fixed after removing the Visual Studio 17.4 preview and reinstall the stable release