Windows IOT Raspberry Pi File Load Exception - windows-10-iot-core

I have recently upgraded my Windows 10 machine to version 1709 and I have a problem debugging my app on my Raspberry pi.
The app is a background app and I get the following exception in the output window and the IBackgroundTask run method is never called.
Exception thrown: 'System.IO.FileLoadException' in System.Private.CoreLib.ni.dll
This is all I get - no idea on how to look further into this as there is no information on what it could not load.
I have tracked it down to me creating a class (simple creating am empty class is enough to show the error)
AquariumControllerPiLibrary.ABC c = new AquariumControllerPiLibrary.ABC();
This class is defined in a separate Class Library assembly.
The class source code is
using System;
namespace AquariumControllerPiLibrary
{
public class ABC
{
}
}
If I comment out the class the Run method executes and I can debug the application and I do not get the fileLoadException.
Any idea how I can find out what did not load?
The debug lines from the output window.
'backgroundTaskHost.exe' (CoreCLR: DefaultDomain): Loaded 'c:\data\Programs\WindowsApps\Microsoft.NET.CoreRuntime.1.1_1.1.25915.0_arm__8wekyb3d8bbwe\System.Private.CoreLib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\AquariumControllerPi.winmd'. Symbols loaded.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'c:\data\Programs\WindowsApps\Microsoft.NET.CoreRuntime.1.1_1.1.25915.0_arm__8wekyb3d8bbwe\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\WinMetadata\Windows.winmd'. Module was built without symbols.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\System.Runtime.InteropServices.WindowsRuntime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\System.Threading.Tasks.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded
'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\ABC.dll'. Symbols loaded.
'backgroundTaskHost.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\AquariumControllerPIVS.Debug_ARM.CCROWE\System.Runtime.WindowsRuntime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.IO.FileLoadException' in System.Private.CoreLib.ni.dll

Related

Debugging Chrome Crashpad crash report from Mac

My application somehow manages to crash a customer's Chrome browser on Mac. I asked the customer to enable crash reports and send me the dump file next time it happens. I got a Crashpad.zip file that contains a bunch of .dmp files. I suppose each file represents a Chrome tab's process. Trying to open these dumps with Visual Studio or WinDbg doesn't work. Note that the dump files were captured on Mac and I'm working on Windows.
When trying to see the callstack with ~k I get the output:
0:000> ~k
# Child-SP RetAddr Call Site
00 00000001`6ee35960 00000000`00000000 Google_Chrome_Framework+0x4486b50
When trying to load symbols from Chromium symbol server I get:
0:000> .sympath+ SRV\*C:\symbols\*https://chromium-browser-symsrv.commondatastorage.googleapis.com
Symbol search path is: srv*;https://chromium-browser-symsrv.commondatastorage.googleapis.com;SRV\*C:\symbols\*https://chromium-browser-symsrv.commondatastorage.googleapis.com
Expanded Symbol search path is: cache*;SRV*https://msdl.microsoft.com/download/symbols;https://chromium-browser-symsrv.commondatastorage.googleapis.com;srv\*c:\symbols\*https://chromium-browser-symsrv.commondatastorage.googleapis.com
************* Path validation summary **************
Response Time (ms) Location
Deferred srv*
Deferred https://chromium-browser-symsrv.commondatastorage.googleapis.com
Deferred SRV\*C:\symbols\*https://chromium-browser-symsrv.commondatastorage.googleapis.com
*** WARNING: Unable to verify timestamp for Google Chrome Framework
0:000> .reload
................................................................
................................................................
................................................................
................................................
Unable to load image /Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/101.0.4951.54/Google Chrome Framework, Win32 error 0n2
*** WARNING: Unable to verify timestamp for Google Chrome Framework
************* Symbol Loading Error Summary **************
Module name Error
Google Chrome Framewor The system cannot find the file specified
My question is how can I get symbols for the crash dump and debug it?
Crashpad writes its dumps in what is, effectively, a Windows minidump format. The current WinDbg Preview (1.2205.18001.0) in the Microsoft store can indeed open and debug crashpad dumps from platforms other than Windows (including Linux and Mac OS). It understands and has support for MachO images, MachO symbols, and private DWARF symbols contained in MachO.
That said -- for that to be useful -- the images and symbols for what is loaded in the target process need to be discoverable by the debugger. I have limited experience on the Chromium front; however, as far as I'm aware, the symbol servers only index the Windows versions there.
Linux ELF and Mac MachO images can indeed be indexed on a symbol server. Documentation regarding that and the indexing key formats is available at https://github.com/dotnet/symstore/blob/main/docs/specs/SSQP_Key_Conventions.md
If you have the images/symbols from downloading something directly (e.g.: a debug package, etc...), you can put them in a local path, point the debugger at such with .sympath and .reload.
I believe that Chromium also has their own set of tools for extracting information from crashpad dumps: https://www.chromium.org/developers/decoding-crash-dumps/

Xamarin forms Windows Phone Silverlight 8.1 Application can't debug (VS2013 ultimate update 5)

When I trying Debug Xamain forms application target windows phone 8.1 (device or simulator) silverlight application, but always output this error and end the debug mode.
Anyone got idea how to fix this?
OS: windows 8.1 pro
IDE: visual studio 2013 ultimate update 5
Project: Xamarin forms windows phone 8.1 project
I have try another PC, same code but vs2013 update 4, it can run very well but some how I don't know why, it also appear this issues just now.
AéHost.exe’ (CoreCLR: Silverliéht AppDomain): Loaded lCIKwindows\system32KWinMetadataKWindows.winmd’. Cannot-find or open the PDB file.
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCI\DataKProgramsK{7AACo885n84A3u4FFE-B677-3218599B3691}\Install\Xamarin.Forms.Platform.WP8.DLL’.
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCI\DataKProgramsK{7AACo885n84A3u4FFE-B6??-3218599B3691}\Install\CrossPlatform.DLL’. Symbols loade
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded ’C:\DataKProgramsK{? AA50885*84A3“4FFE-B6??-3218599B3691}KInstallKXamarin.Forms.Core.DLL’. Module w
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCI\windowsKsystem32KSystem.Runtime.ni.dll’. Symbols loaded.
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCIKwindowsKsystem32KSystem.UbjectModel.ni.dll’. Symbols loaded.
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCIKwindowsKsystem32KSystem.Collections.ni.dll’. Symbols loaded.
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCI\windowsKsystem32KSystem.Linq.ni.dll’. Symbols loaded.
A first chance exception of type System.Io.FileNotFoundException occurred in CrossPlatform.WinPhone.DLL
AgHost.exe’ (CoreCLR:Silverlight AppDomain): Loaded lCI\windowsKsystem32Ken-USKmscorlib.debug.resources.dll’. Module was built without symbols.
A first chance exception of type lSystem.Reflection.TargetInvocationException’ occurred in mscorlib.ni.dll
A first chance exception of type lSystem.Reflection.TargetInvocationException’ occurred in Microsoft.Phone.ni.dll
The program ’[5328] AgHost.exe’ has exited with code -1 (Uxffffffff).
Package Manager Console Error List Output
After long time investigate, I found out that the windows phone 8.1 SDK isn't install correctly, for those who still have this kind of problem, please check your visual studio components.

Windows Phone 8.1 throws a FileLoadException on startup

I'm currently building a Windows Phone 8.1 App (WinRT). I can build it in Debug Mode in Visual Studio 2013 without any problems. It is also runs in the emulator and on a real device. But when I build the app in Release mode it crashes instantly on both the emulator and the device.
In the Debug Output windows of Visual Studio I can see that a FileLoadException is thrown on startup. This means:
The exception that is thrown when a managed assembly is found but
cannot be loaded.
https://msdn.microsoft.com/de-de/library/system.io.fileloadexception%28v=vs.110%29.aspx
Unfortunately I can not see which assembly causes the problem! Is there any means to make the information visible?
A first chance exception of type 'System.IO.FileLoadException' occurred in MarketIQ.exe
A first chance exception of type 'System.IO.FileLoadException' occurred in mscorlib.ni.dll
'MarketIQ.exe' (CoreCLR: .): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll
'MarketIQ.exe' (CoreCLR: .): Loaded 'C:\Data\SharedData\PhoneTools\AppxLayouts\c53a5ef4-9f4f-4a1d-a5f4-2e73b5806daeVS.Release_AnyCPU.oprins\Log.Model.Client.DLL'. Cannot find or open the PDB file.
The program '[3020] MarketIQ.exe' has exited with code -1073741189 (0xc000027b).
The problem was device dependent. The app now runs smoothly after a factory reset.

System.Reflection.TargetInvocationException' occurred in mscorlib.dll exception in monogame store game

this my first time developing games in monogame for windows store i am getting exception at line of construct game
var game = new T();
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'D:\windows\windows games\storegame\SABFROG\frog\bin\Windows8\Debug\AppX\frog.exe', Symbols loaded.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\system32\WinMetadata\Windows.UI.Xaml.winmd', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'D:\windows\windows games\storegame\SABFROG\frog\bin\Windows8\Debug\AppX\MonoGame.Framework.DLL', Symbols loaded.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Collections\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.WindowsRuntime\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.WindowsRuntime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\system32\WinMetadata\Windows.Graphics.winmd', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\system32\WinMetadata\Windows.Foundation.winmd', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Extensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'frog.exe' (Managed (v4.0.30319)): Loaded 'D:\windows\windows games\storegame\SABFROG\frog\bin\Windows8\Debug\AppX\SharpDX.DLL'
A first chance exception of type 'System.NullReferenceException' occurred in frog.exe
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll but was not handled in user code
Additional information: Exception has been thrown by the target of an invocation.
The program '[6860] frog.exe: Managed (v4.0.30319)' has exited with code -1 (0xffffffff).
Not sure if this helps, as I've never used monogame, but System.Reflection.TargetInvocationException can happen when you are trying to instantiate a class that has no default constructor (constructor with no parameteres), as I suspect from the code.
var game = new T();
For example:
class MyClass {
public MyClass(string name)
{
//Some code
}
//calling new MyClass("Foo") will work
//calling new MyClass() will cause a TargetInvocationException, because the
//constructor is not defined in the class
}
Do you know what class is being passed as type T in your code?
actually its solved i was accessing user defined methods before intializing the game so that exception was thrown by code.
now i am calling those methods in load method it working fine!!

Monodevelop 2.8.6 on windows

I hope someone can answer this as its driving me crazy. I have installed Monodevelop on windows XP. The version being 2.8.6.5. I set the default/active runtime as Microsoft .Net and set my projects to target .net 4.0 via project settings BUILD-->General->Target framework.
When I debug it from the application output window it loads XSP 2.0 and tries to the old .Net 2 DLL's ie from the .Net 2 GAC - C:\windows\assembly instead of the .Net 4 GAC.
when I debug setting Mono as the active runtime it works ok.
I get the error, which is understandable given the fact the build is targeting .Net 4 yet its looking at the wrong runtime:
Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Here is the output from the Output window:
Loaded Module 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'
Started Thread 1872
Loaded Module 'C:\Program Files\MonoDevelop\bin\xsp2.exe'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\MonoDevelop.Xsp\2.8.0.0__0738eb9f132ed756\MonoDevelop.Xsp.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'
many thanks
Simon.