question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI Blazor: System.IO.FileNotFoundException: '' on InitializeComponent()

See original GitHub issue

Description

My Maui Blazor App on InitializeComponent() is throwing System.IO.FileNotFoundException: ‘’ on Visual Studio, even if I uncheck “Break when this exception type is thrown”

image

dotnet workload list

ID da carga de trabalho instalada      Versão do Manifesto      Origem da Instalação
------------------------------------------------------------------------------------
wasm-tools-net6                        7.0.3/7.0.100            VS 17.6.33513.286
maccatalyst                            16.2.1030/7.0.100        VS 17.6.33513.286
ios                                    16.2.1030/7.0.100        VS 17.6.33513.286
wasm-tools                             7.0.3/7.0.100            VS 17.6.33513.286
maui-android                           7.0.59/7.0.100           VS 17.6.33513.286
maui-windows                           7.0.59/7.0.100           VS 17.6.33513.286
maui-maccatalyst                       7.0.59/7.0.100           VS 17.6.33513.286
android                                33.0.26/7.0.100          VS 17.6.33513.286
maui-ios                               7.0.59/7.0.100           VS 17.6.33513.286

Use `dotnet workload search` para encontrar cargas de trabalho adicionais a serem instaladas.

Steps to Reproduce

Open the project in repository, run Debugging on Android device.

Link to public reproduction project repository

https://github.com/TonyHenrique/bug-2023-03-21

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11.0 - API 30

Did you find any workaround?

No, because even if I uncheck “Break when this exception type is thrown” Visual Studio still stops at that line and I have to click the Continue button a few times.

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jonathanpepperscommented, Apr 10, 2023

Duplicate of #7443

1reaction
jonathanpepperscommented, Apr 10, 2023

So I think the issue is related to satellite assemblies:

0x26 in System.Reflection.Assembly.Load
0x55 in System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly
0x4 in System.Resources.ManifestBasedResourceGroveler.InternalGetSatelliteAssembly
0x4D in System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly
0x31 in System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet
0xA4 in System.Resources.ResourceManager.InternalGetResourceSet
0x5A in System.Resources.ResourceManager.GetString
0x12B in System.SR.InternalGetResourceString
0xC in System.SR.GetResourceString
0x11 in System.Text.EncodingTable.GetDisplayName
0x30 in System.Text.EncodingTable.InternalGetCodePageDataItem
0xB9 in System.Text.EncodingTable.GetCodePageDataItem
0xF in System.Text.Encoding.GetDataItem
0x9 in System.Text.Encoding.get_WebName
0x1 in System.Xml.XmlTextReaderImpl.SwitchEncoding
0x235 in System.Xml.XmlTextReaderImpl.ParseXmlDeclaration
0xC8 in System.Xml.XmlTextReaderImpl.Read

In this case, the XmlReader just happens to hit the same problem as: https://github.com/dotnet/maui/issues/7443

Let me close this as duplicate, I’ll link to your example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New .Net MAUI App project throws 'The name ...
First things first The error is about the context that the InitializeComponent() resides in. Context is nothing but the nuget package dependency ...
Read more >
Announcing .NET MAUI Preview 4 - .NET Blog
NET MAUI now has enough building blocks to build functional applications for all supported platforms, new capabilities to support running Blazor ...
Read more >
FileNotFoundException is raised on an attempt to open ...
IO.FileNotFoundException Exception Info: System.IO.FileNotFoundException at System.ModuleHandle. ... InitializeComponent() at DevExpress.
Read more >
VS extension error while creating solution with template ...
Windows.ResourceDictionary.Source' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.Windows.
Read more >
C# System.IO.FileNotFoundException when creating ...
I try to debug but it crashes here and i cant seem to break inside the constructor. static void Main() { Application.EnableVisualstyles(); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found