1

Issue


This issue has only just started happening but its stopping other people installing the application and running it.

I am able to run the application on my VS2015 and also i can install the application on my machine and run it. When another uses installs the application nothing loads up and they get an EventLog:

Fault bucket 129060628035, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: Podia2016.exe
P2: 1.0.0.0
P3: 56fe6f19
P4: System
P5: 4.6.1038.0
P6: 5615c2d1
P7: 2d06
P8: 11b
P9: System.Security.Security
P10: 

Recently as well the application has been getting notifications when installing that it could be a harmful program and i have to allow it. Like i said, this has only just recently happened and it causes all types of issues.

Code


The only things i can think of that can cause this is I have to Read and Write to the users registry (Writing):

RegistryKey key = Registry.CurrentUser.OpenSubKey("Software", true);

key.CreateSubKey("Podia2016");
key = key.OpenSubKey("Podia2016", true);

key.CreateSubKey("v1");
key = key.OpenSubKey("v1", true);

key.SetValue("URL", serverURL);
key.SetValue("UID", username);
key.SetValue("PWD", password);

I also Read the registry:

RegistryKey key = Registry.CurrentUser.OpenSubKey("Software", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.ReadKey);
key = key.OpenSubKey("Podia2016", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.ReadKey);
key = key.OpenSubKey("v1", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.ReadKey);

I really don't know how I can actually find out what is the problem with my application. Any help or ideas would be great!

EDIT:

I have just commented out everything on my login page and the page appeared successfully leading my to believe that either the application does not have access to Write to the EventLog, it is not able to Read/Write from the registry or that it does have access to create a file.

If i run my application as Admin this does not help.

Ben Clarke
  • 1,051
  • 4
  • 21
  • 47
  • check out this [SO question](http://stackoverflow.com/questions/4052770/deciphering-the-net-clr20r3-exception-parameters-p1-p10) and here is the docs for the [System.Security.Security exception](https://msdn.microsoft.com/en-us/library/system.security.securityexception(v=vs.110).aspx) – Gordon Allocman Apr 01 '16 at 13:14
  • @GordonAllocman So mine is a security exception but why? because i'm writing to the eventlog? – Ben Clarke Apr 01 '16 at 13:18
  • Event logs are not cool. You have to start with adding [unhandled exception logging](http://stackoverflow.com/q/1472498/1997232) to your application. Then you'll know exact line where problem occurs (assuming you supply pdb-file). – Sinatr Apr 01 '16 at 13:21
  • @BenClarke every call of OpenSubKey could potentially be throwing a SecurityException – Gordon Allocman Apr 01 '16 at 13:27
  • @GordonAllocman The thing is if OpenSubKey was causing the issue the page would load up then error as OpenSubKey does not straight away. – Ben Clarke Apr 01 '16 at 13:30
  • @BenClarke Then add some of the initialization code to the post if that is when the app is crashing – Gordon Allocman Apr 01 '16 at 13:32

1 Answers1

0

You can add an exception handler in your MainWindow.cs file and check the exception object you get.

public MainWindow()
{
    AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
    Windows.Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
}


void Current_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
}

void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
}
Ikarus76
  • 14
  • 2