Exception in UWP on device and emulator - c#

So, the problem: I have working application on UWP, written on C# and C++. It works as it must work on desktop in releas and debug modes. It worked on mobile devices and emulator not so long before some changes happend in C++ part. But now application crashes at the begining of C++ part if application opens on emulator or mobile. MSVS gives me this messages, but It does't helped:
Exception thrown at 0x7767B928 (ntdll.dll) in rhodes.exe: 0xC0000139: Entry Point Not Found.
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.Interop.dll
The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.Interop.dll
Exception thrown at 0x76EA2812 (KernelBase.dll) in rhodes.exe: 0x40080201: WinRT originate error (parameters: 0x8007007F, 0x00000050, 0x03B0E2DC).
Any ideas?

Go to Debug -> Windows -> Exception, and enable breaking on all exception types (C++, CLR and Win32) ones. Depending on where the issue comes from, you'll need to use either native or managed mode debugging (you can set it in Project Properties -> Debug tab). Now, the project should hit a breakpoint when you hit that exception, which will point you to where it is coming from.

Related

'System.IO.EndOfStreamException' in JetBrains.ReSharper.TaskRunnerFramework.dll

When trying to run a very basic xunit test in debugging mode my test project throws several exceptions which seems to come from ReSharper.
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Could not find file 'C:\Temp\test\TestProjekt\TestProjekt\bin\Debug\TestProjekt.xunit.runner.json'.
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Could not find file 'C:\Temp\test\TestProjekt\TestProjekt\bin\Debug\xunit.runner.json'.
Managed Debugging Assistant 'LoadFromContext'
The assembly named 'xunit.runner.utility.net452' was loaded from 'file:///C:/Program Files (x86)/JetBrains/Installations/ReSharperPlatformVs15_0a4dd3ad/xunit.runner.utility.net452.dll' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.
testException thrown: 'System.Threading.ThreadAbortException' in xunit.execution.desktop.dll
Thread was being aborted.
Exception thrown: 'System.Threading.ThreadAbortException' in xunit.execution.desktop.dll
Thread was being aborted.
Exception thrown: 'System.Threading.ThreadAbortException' in mscorlib.dll
Thread was being aborted.
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Access to the path 'TestProjekt.PDB' is denied.
[...]
Exception thrown: 'System.UnauthorizedAccessException' in mscorlib.dll
Access to the path 'TestProjekt.PDB' is denied.
Exception thrown: 'System.IO.EndOfStreamException' in JetBrains.ReSharper.TaskRunnerFramework.dll
Attempted to read past the end of the stream.
The program '[14628] JetBrains.ReSharper.TaskRunner.CLR45.x64.exe: Program Trace' has exited with code 0 (0x0).
The program '[14628] JetBrains.ReSharper.TaskRunner.CLR45.x64.exe' has exited with code 0 (0x0).
What I have tried so far:
Moved Project away from Default Profile Folder to c:\temp...
Starting Visual Studio 2017 with local admin rights
Updating ReSharper to the latest Version currently available (2018.2.1)
Clearing ReSharper Cache
Clean entire solution
Create new empty class library Project and pull in xunit nuget packages afterwards (.NET Framework 4.7.2)
Downgrading solution to .NET Framework 4.7
Reinstall ReSharper and choose "Install for all users" instead of my user only, to ensure there are no left Overs in my Profile...
It seems that the same test project can be debugged without any issue on the Workstation of a Team mate... so there must be something wrong with my Installation.
What am I doing wrong here? Any ideas?
Enabling Just my Code in Visual Studio at least stops this first Chance exceptions from cluttering my Output. So thats Kind of a Workaround...

UWP Xamarin.Forms 'System.IO.FileNotFoundException' occurred in System.Private.Reflection.Core.dll

My UWP app crashes on Xamarin.Forms.Forms.Init(e, assemblies) with
**Exception thrown:
'System.IO.FileNotFoundException' in
System.Private.Reflection.Core.dllFileNotFound_AssemblyNotFound,
clrcompression**
The app don't crash if I uncheck 'System.IO.FileNotFoundException' from Exception settings, but it's not the best solution because if I uncheck this exception I have another problem with Storage API(I can't use the StorageFolder to get files because the execution doesn't return and no exception is thrown).
I don't know if this problem can be releated with the first exception, but
can anyone fix this problem?
The problem was async/await method when I use Storage API, and for System.IO.FileNotFoundException I had to update Visual Studio.

UnityContainer.Resolve crashes when .NET Native tool chain is enabled

We have a Windows 10 UWP app that runs fine under Debug builds and crashes under Release builds. What it is about release builds that makes it crash is that .NET Native tools chain is enabled - disabling that allows the app to run. But that's not a real fix as it needs to run with .NET Native tool chain if you intend to publish to the store.
We use Microsoft.Practices.Unity for DI. Here's an example of how we register some classes:
container.RegisterType<IBoardView, BoardView>();
And then, in our app we resolve it as follows:
container.Resolve<IBoardView>();
It works fine unless I run it with .NET Native, in which case I get the following exception:
An exception of type 'Microsoft.Practices.Unity.ResolutionFailedException' occurred in Microsoft.Practices.Unity.dll but was not handled in user code
Additional information: Resolution of the dependency failed, type = "WindowsUniversal.ViewModels.Interfaces.IBoardViewModel", name = "(none)".
Exception occurred while: while resolving.
And in the output window I get:
Exception thrown: 'System.NullReferenceException' in System.Linq.Expressions.dll
Exception thrown: 'System.NullReferenceException' in Microsoft.Practices.Unity.dll
Exception thrown: 'Microsoft.Practices.Unity.ResolutionFailedException' in Microsoft.Practices.Unity.dll
An exception of type 'Microsoft.Practices.Unity.ResolutionFailedException' occurred in Microsoft.Practices.Unity.dll but was not handled in user code
Additional information: Resolution of the dependency failed, type = "WindowsUniversal.ViewModels.Interfaces.IBoardViewModel", name = "(none)".
Exception occurred while: while resolving.
Exception is: NullReferenceException - Object reference not set to an instance of an object.
At the time of the exception, the container was:
Resolving WindowsUniversal.ViewModels.Interfaces.IBoardViewModel,(none)
All this works under Debug or Release when .NET Native is disabled. Now I know .NET Native has it's limitations, reflection being one of them. I guess I'm asking how to get around this?
Any insights would be greatly appreciated, thanks.

debugger does not stop on error

I'm working on Asp.net MVC4 project using Visual Studio 2012.
When there's an error during debugging, it used to stop on the error.
But suddenly, the debugger does not stop and just spit out the error information webpage like below.
Server Error in '/' Application.
The given key was not present in the dictionary.
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.Collections.Generic.KeyNotFoundException:
The given key was not present in the dictionary.
Source Error: ...
Stack Trace: ...
How can I set the debugger to stop on the error?
I had the same problem, even my debugging options are the same as #John Koerner.
I found that not all exception types are enabled to break the solution by default. You can choose which are enabled from the Exception Setting window.
VS2015: Debug -> Windows -> Exception Settings.
VS2012: Debug -> Exceptions more details
I enabled the whole CLR Exceptions set.
Make sure the exception assistant is enabled:

Find exception in WPF Prism application

I have three, essentially same, WPF/Prism/Mef applications which are installed in a single installation package built with visual studio. Two of them works fine and in one of them i get
An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '9' and line position '18'.
The application works fine on my dev computer, but on my target machine it fails.
Problem is that the error seems to occur even before the bootstrapper, i have a hard time trying to locate the problems, anyone has any ideas on how to find the bug.

Categories

Resources