Uwp app crash immediately after compiled with .net native toolchain - c#

I'm creating an uwp app. My app works well in debug mode. But when compiled with .net native toolchain, which is essential to publish app to the Store, it crash immediately. I was trying to enable all the exception settings but it didn't hit any breakpoints. All the information I can get from the output is:
The program '[9548] DemoBuildError.exe' has exited with code
-1073741511 (0xc0000139) 'Entry Point Not Found'. Activation of the Windows Store app
'9e380736-23cf-476f-b625-be7baa70ad56_jatac5brr3jea!App' failed with
error 'The app didn't start'.
I also try to create new project and copy, paste carefully as mentioned in some previous threads but no luck.
Here is my demo project to reproduce the error: https://bitbucket.org/wpdev01/demobuilderror
Any ideas?

Since your repo is private, I'm also facing the same problem, I guess it's due to some third party controls your refered.
In my project, I unloaded all third party controls, it works fine again.

in your case its quite a problem.
try to add "unhandledexception" :https://learn.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?view=netframework-4.8
debug and see what's next.
in debug mode compiler optimizations are turned off but the app is should work the same.

Related

Could not load file or assembly.. Even though its there in the proper location and builds fine

I have a predominantly managed c# .net 4.6 app that is trying to call into a c++ dll (that is also built as part of the solution), Visual Studio 2017.
I get this exception:
"System.IO.FileNotFoundException: 'Could not load file or assembly 'XXX.dll' or one of its dependencies. The specified module could not be found.'"
There doesn't appear to be any more information. The dll is in our binaries directory with all our other dlls that load fine, and the exe that is being run in the debugging session (The start up project).
I've checked the solution configuration manager, its building the dll as x64 in our Debug|Any CPU config, which makes sense.
No one else in the office has this issue, and I didn't have this issue on my old computer (I'm getting now trying to set up my new dev computer, which is the exact same specs as the old one) Windows 10.
I have the WindowsSDK 8.1 and 10 installed, and the vs c++ redistributes.
Any Ideas? Or atleast, and idea how I can get more info about whats actually going wrong? (This exception is frustratingly vague).
You’d want to use Fuslogvw.exe, the assembly binding log viewer. It can be started by launching the Developer Command Prompt for VS. The first thing is to enable logging, and the simplest way is to run as administrator (as a comment to an answer here correctly points out); you can alternatively set the ForceLog regkey specified here if running as a regular user account.
There's also a small video I did a while back to test how this works. You can find this in this article. Just scroll to the bottom, it's within the 2nd question starting from the end.
If that doesn't work, run Process Monitor and set a filter for your specific .dll and see what the CLR does in detail when searching for it.

testDefaultGrantsWithRemoteExceptions in Xamarin.Android

Recently I have implemented firebase in my Xamarin Android project.
After that it is working successfully in Debug mode,but when i go to release mode,
application is getting installed but crashes on opening.
I saw the Device log,saw some error saying-
testDefaultGrantsWithRemoteExceptions:android.content.pm.PackageManager$NameNotFoundException: com.google.android.permission.gts
I am not sure whether it is related to firebase or something else.
Just visited the link-
https://sunj.iteye.com/blog/2387714
How can i do this in Xamarin.Android where this method can be implemented,
also how will it effect application.
Also is there any way to see the reason why application is crashing,there is no error ,no exception.In output window also nothing weird showing,but still crashes in Release mode.
Thanks,

CEF with ChromiumFX "failed to establish GPU channel" error when run in VS debugger

I am running a Winforms app using the standard ChromiumFX and ChromiumWebBrowser components. CEF version is 3.2171.2069_windows32, and ChromiumFX is 3.2171.1979.9, referenced as dlls.
I have only one form which has only the ChromiumWebBrowser control. The app is start-up code is the same as here. When I download that source and run it, the test application runs ok in my VS debugger. This is using a more recent CEF and FX version.
In my app when I run it in the debugger it shows an empty form and the CEF log contains this entry:
[0724/004741:ERROR:gpu_process_transport_factory.cc(437)] Failed to
establish GPU channel.
When I run the compiled exe outside of VS, it runs perfectly fine.
I can't figure out what the problem could be.
I tried running without the sandbox, I tried running in debug and in release.
So, to reproduce, download ChromiumFX and CEF version 3.2171.2069 (from here. Create a WinForms project, reference ChromiumFX and ChromiumWebBrowser. Add one form containing a WebBrowser, update the Program.cs to match the one shown earlier. And copy CEF files to the paths defined in Program.cs.
After some off-list discussion with the OP the problem was found:
You have to disable the "Enable the Visual Studio hosting process" checkbox in Project Properties->Debug. It interferes with the secondary processes.
Alternatively, use CfxSettings.BrowserSubprocessPath and specify the path to your executable.

EXE not running, accidental change in configuration?

I've been working on a simple project that uses some common .NET classes, isolated storage, some resources and no external libraries.
Somehow the EXE generated (either in debug or release mode) no longer runs (stops working as soon as it's opened) without giving any details or displaying any exceptions.
It runs normally in visual studio, and there's a .application in the same folder that when clicked starts in install process.
I'm not interested in installation files, I just want it to be the way it was: running an EXE (it's easier to get testers when all you have to do is running it).
I have previous versions of the program, and all of them run normally through the EXE's.
I don't recall changing anything regarding framework, deployment or build. I revised it and there's nothing changed apart from using new objects from the .NET framework.
--[Update]--
Just checked the event viewer. Event data "not available" and answer "not available".
This is a classic example of when a personal version control system would have helped. It would have automatically kept every version of your code including the one right before you made the change that messed up your exe.
Anyway to fix your issue comment out the majority of the code untill it atleast runs. Add a simple output statement just to make sure it is doing something. Then slowly add back in more code.
I suggest you to run your exe file in a consol (cmd.exe) to see if your application displays errors or exceptions in it.
Check the <YourAppName>.Exe.Config file.
Probably it is not well-formed Xml.
I'd start with removing the setup project from the solution, rebuilding then run it in debug mode.

MissingMethodException thrown when calling new form in Compact Framework

I'm updating an old mobile device application for better flexibility. I had basically added the ability to configure the address of our SQL server in the case that we want to use our test server as opposed to our production server. I don't think this is causing the problem, but I wanted to state it. I also upgraded the project from a VS 2003 project to a VS 2005 project.
The issue I am having is that when I try to run the program in the VS emulator for Pocket PC, I get an error. It occurs after our "main menu" form loads and the user selects the next form to load. The form is initialized without issue, but when we try to run the .ShowDialog() method, it throws a System.MissingMethodException.
I don't have a lot of experience with the Compact Framework and really have no idea where to start looking for problems. I stepped the debugger through the entire initializing process for the new form and it ran without issue. But, again, when we come to the ShowDialog call, it throws the error.
Any ideas in where to start looking or known issues would be greatly appreciated.
I'm usually getting MissingMethodException for this reason:
I've got at least two files in my project, for instance an .exe file and a .dll file
I make changes to the .dll file's source code, and recompile
VS says it deploys the new .dll file to the device, but indeed it does not (it keeps the old file)
The .exe starts up fine, but when it starts accessing the .dll file the application throws a MissingMethodException, because it can't find the methods in the old dll file.
Fix: Delete the entire application directory from the device and redeploy.
I should have added this long ago. The answer ended up being that the incorrect version of .NET was installed on the Mobile Device.
A possible issue that can cause this situation is that the DLL is not being updated when deployed. It can be caused by the DLL in question being a dependency for more than one executable.
For example let's say executable A is running on the device and it is dependent on the DLL's method callA. You are trying to debug executable B which is also dependent on the DLL but on the method callB that you just added. When Visual Studio goes to deploy the DLL with callB in it, it is unable to do so because executable A is still using it. Visual Studio does not tell you that it was not successful in deploying the DLL. (Liar VS! ;)
To fix it, kill all the executables that depend on the DLL and then deploy it.
#Felix Alcala - You got an up vote from me. I would add this as a comment to your fix because it is directly related. Alas, I did not have the rep to do so. But, I want this answer to be public because I found it helpful
Start looking in the ShowDialog method itself. The error is slightly misleading - it's not ShowDialog which it can't find, but the JIT compiler is probably trying to compile ShowDialog, and throwing that exception (because ShowDialog is trying to call something it can't find). If ShowDialog is in a different assembly, then there may be something static that can't be initialized, which could similarly cause this - but start out looking in ShowDialog itself.
Because of this, one trick to finding the problem (if it isn't obvisou) is to reduce the code in ShowDialog until you find the line causing the problem. I'd start out commenting ALL the code, to confirm my hypothesis. If you no longer get the exception, try uncommenting about half of the remaining code at a time, etc.
You can get this exception when you try to use a regular WinForm class from a compact project.

Categories