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

Could not resolve assembly on .NET MAUI App project template and System.IO.FileNotFoundException #14844

Closed
Alfort-G opened this issue Apr 29, 2023 · 2 comments
Labels

Comments

@Alfort-G
Copy link

Description

When I run the sample .NET MAUI App on my local iPhone I get the following error messages:

2023-04-29 10:45:51.574 Xamarin.PreBuilt.iOS[5608:176993] 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/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

2023-04-29 10:45:51.578 Xamarin.PreBuilt.iOS[5608:176993] 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/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.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:423 [0x00000].
Loaded assembly: /private/var/containers/Bundle/Application/4F7C349B-76DE-409E-B83A-391BDDE3E0F8/MauiApp1.app/System.Text.Json.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/4F7C349B-76DE-409E-B83A-391BDDE3E0F8/MauiApp1.app/System.Text.Encodings.Web.dll [External]
System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.'

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.'

2023-04-29 10:45:55.043 Xamarin.PreBuilt.iOS[5608:176993] 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/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

Thread started: #8
2023-04-29 10:45:55.859 Xamarin.PreBuilt.iOS[5608:176993] 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/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000].
Thread started: #9
Thread started: #10
Thread started: #11
System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.'

System.IO.FileNotFoundException: ''

2023-04-29 10:45:57.166 Xamarin.PreBuilt.iOS[5608:176993] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en-GB, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.'

2023-04-29 10:45:58.789 Xamarin.PreBuilt.iOS[5608:176993] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/4D20B99E-C406-456C-A104-04CC39E02986/Documents/MauiApp1.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

System.IO.FileNotFoundException: ''

Steps to Reproduce

On Visual Studio Enterprise Version 17.5.4 running on a physical Intel Windows machine.

  1. I plug my iPhone SE3 iOS version 16.4.1 to my computer
  2. Create a new .NET MAUI App project on Visual Studio
  3. Select iPhone on "iOS Local Device"
  4. Follow Hot Reload wizard
  5. Run the solution
  6. The errors appear on the Debug Output console and if all Exceptions are set to break when thrown, the app breaks giving System.IO.FileNotFoundException occurrences
  7. The app opens though

On my real app I get more error messages as in below and after passing all the Exception breaks my app just terminates, I guess due to some timeouts. I have spent a number of hours with this and has created me a lot of confusion. Please can this be clarified/fixed.

2023-04-29 11:05:56.519 Xamarin.PreBuilt.iOS[5711:186348] 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/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

2023-04-29 11:05:56.522 Xamarin.PreBuilt.iOS[5711:186348] 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/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.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:423 [0x00000].
Loaded assembly: /private/var/containers/Bundle/Application/6B851609-AEFC-4164-98C4-2FE2585C2F49/MauiWebBrowser.app/System.Text.Encodings.Web.dll [External]
System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.'

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.'

2023-04-29 11:05:58.851 Xamarin.PreBuilt.iOS[5711:186348] 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/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

2023-04-29 11:05:59.894 Xamarin.PreBuilt.iOS[5711:186348] 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/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000].
Thread started: #9
Thread started: #10
Thread started: #11
System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.'

2023-04-29 11:06:01.140 Xamarin.PreBuilt.iOS[5711:186348] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en-GB, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

System.IO.FileNotFoundException: ''

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.'

2023-04-29 11:06:03.429 Xamarin.PreBuilt.iOS[5711:186348] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

System.IO.FileNotFoundException: ''

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.EntityFrameworkCore.resources.dll' or one of its dependencies.'

2023-04-29 11:06:05.871 Xamarin.PreBuilt.iOS[5711:186348] Could not resolve assembly Microsoft.EntityFrameworkCore.resources, Version=7.0.5.0, Culture=en-GB, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.EntityFrameworkCore.resources.dll' or one of its dependencies.

System.IO.FileNotFoundException: ''

System.IO.FileNotFoundException: 'Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.EntityFrameworkCore.resources.dll' or one of its dependencies.'

System.IO.FileNotFoundException: ''

2023-04-29 11:06:08.370 Xamarin.PreBuilt.iOS[5711:186348] Could not resolve assembly Microsoft.EntityFrameworkCore.resources, Version=7.0.5.0, Culture=en, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/F87432D5-1440-42ED-B440-E2601AFE20C7/Documents/MauiWebBrowser.content/Microsoft.EntityFrameworkCore.resources.dll' or one of its dependencies.

The app has been terminated.

Link to public reproduction project repository

None

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS, I was not able test on other platforms

Affected platform versions

iOS 16.14.1, Visual Studio Enterprise 17.5.4

Did you find any workaround?

Disable break on Exceptions, but loosing that functionality

Relevant log output

No response

@Alfort-G Alfort-G added the t/bug Something isn't working label Apr 29, 2023
@drasticactions
Copy link
Contributor

I don't believe this to be a MAUI (The UI Framework) issue. The exceptions being thrown are for resource files, and it's part of the normal flow of the runtime to check for them the way it is. You see the exception because you're turned on showing all exceptions. This would happen if you were to run an iOS app with the same libraries without the MAUI UI Framework being installed (Such as Entity Framework Core, which you installed).

I would probably take this to https://github.com/dotnet/runtime and see what they say, but this doesn't happen on just MAUI UI Framework DLLs.

@drasticactions drasticactions closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2023
@Alfort-G
Copy link
Author

Alfort-G commented Apr 30, 2023

This is about the sample app that comes with the Visual Studio template, which already throws the error messages I put at the beginning without turning on the exceptions. I also put other errors of my app, different from the Visual Studio sample app. Why is this not MAUI as it is just what happens with a fresh template MAUI project?

@ghost ghost locked as resolved and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants