Monotouch crashes with no exceptions - exception

I built a monotouch app it randomly crashes after user fnishes signup the problem is that no exception is being thrown, I tried to catch that with the debugger while testing it on a device (of course I set it up to catch all exceptions) I even tried to set up crash tool such as HockeyApp but those crashes don't appear any where.
How can I solve this? help please!

You should check out Raygun.io. It will log any unhandled exceptions to the dashboard. Add it via a nuget package and then you can set it up with one line in your Main.cs:
namespace Myapp.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
Mindscape.Raygun4Net.RaygunClient.Attach("enter your api key here");
UIApplication.Main(args, null, "AppDelegate");
}
}
}

Related

Windows phone 8.1 app crashing while using libphonenumber-csharp

I am trying to use libphonenumber-csharp library for my windows phone project for validating international phone numbers. I have installed the library using the following command on nuget package manager console:
Install-Package libphonenumber-csharp
I am using the following click event handler to test the functionality of the library:
private void buttonCall_Click(object sender, RoutedEventArgs e)
{
String bdNumberStr = "0123456789";
PhoneNumbers.PhoneNumberUtil phoneUtil = PhoneNumbers.PhoneNumberUtil.GetInstance();
try
{
PhoneNumbers.PhoneNumber numberProto = phoneUtil.Parse(bdNumberStr, "BD");
}
catch (PhoneNumbers.NumberParseException exc)
{
Debug.WriteLine("NumberParseException was thrown: " + exc.Message);
}
}
The program is crashing after clicking the button. The event handler function is not getting hit and an exception is thrown. In output window it says something like the following:-
Loaded 'C:\Data\Programs{60688B3F-2E3D-46EE-B0DE-C1F3E22F0912}\Install\PhoneNumbers.DLL'. Cannot find or open the PDB file.
Does anyone have an idea whats going wrong here?
You can't use this package, this library built for desktops, not for Windows Phone or Store apps.
You need to port it by yourself or find another solution.

visual studio 2015 not stopping on exception line of code

I just installed visual studio on my desktop and was creating a test solution to learn my way around. I created a solution with 2 projects, one of an IDataReader implementation of a CSV reader and another windows form app to display the reader in a datagridview.
The Reader generates an exception as expected, but it does not stop on the line of code which threw the exception. The reader gets instantiated correctly. But when I go to load it into a datatable it throws an exception on Table.Load(Reader)
The exception is occurring somewhere inside the reader but it is not stopping where the exception is actually occurring.
My dataReader looks like this:
public class DelimitedReader : IDataReader{....lots of code here...}
My form accesses the Delimitedreader like this:
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
try
{
DelimitedReader Reader = new DelimitedReader(openFileDialog1.FileName);
DataTable Table = new DataTable("Data");
Table.Load(Reader);<<<<<<<<Exception stops on this line of code
Grid.DataSource = Table;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
I have:
turned on the CLR exceptions in the "Exception Settings Window"
made sure "Debug Info" was set to Full on both projects
Turned on XML documentation for both, which I think is unnecessary
What am I missing?
My guess is that your reader does a throw new Exception. This causes VS to stop at a higher level exception handler.

stackoverflow exception on calling asmx service from scheduletaskagent in wp8

I have a wp8 project that references a wp8 class library. The class library has a service reference. I also have a wp8 task agent project that references the class library to update the live tiles. When calling the service methods from the phone project everything works great but when I call a service method from the task agent I start getting a stack overflow exception or out of memory exception.
protected override void OnInvoke(ScheduledTask task)
{
string userName = GetUserName(); //from isolated storage
MyServiceClient client = new MyServiceClient ();
client.GetDataCompleted += client_GetData;
client.GetDataAsync(username);
}
The error occurs on GetDataAsync. However when I use the same code in the phone app(not the task agent) everything is working fine.
Has anyone noticed something similar?
Thanks,
Kunal

Play specs with configuration break because "There is no started application"

I externalized some strings to HOCON, on application.conf. I'm accessing the configuration values like this:
import play.api.Play.current
import play.api.Play.configuration
configuration.getString("foo.bar").get()
As early as possible, to fail fast in case of a missing key, like the docs say.
Now some of my tests that depend on configured objects are failing with a stacktrace that states:
Caused by: java.lang.RuntimeException: There is no started application
I assume this has to do with the configuration? How can I fix this? (tests are specs2)
Do you have a FakeApplication running? As stated in the documents: http://www.playframework.com/documentation/2.0/JavaTest before you run the test/ test method?
Example from the Wiki:
#Test
public void findById() {
running(fakeApplication(), new Runnable() {
public void run() {
Computer macintosh = Computer.find.byId(21l);
assertThat(macintosh.name).isEqualTo("Macintosh");
assertThat(formatted(macintosh.introduced)).isEqualTo("1984-01-24");
}
});
}
If this is not solving your issue, perhaps providing more information from the Stacktrace would help.
EDIT: Please tag your question carefully, it does not make sense to mention playframework AND playframework-2.0

Final managed exception handler in a mixed native/managed executable?

I have an MFC application compiled with /clr and I'm trying to implement a final handler for otherwise un-caught managed exceptions. For native exceptions, overriding CWinApp::ProcessWndProcException works.
The two events suggested in Jeff's CodeProject article,Application.ThreadException and AppDomain.CurrentDomain.UnhandledException, are not raised.
Can anyone suggest a way to provide a final managed exception handler for a mixed executable?
Update:
It appears that these exception handlers are only triggered downstream of Application.Run or similar (there's a worker thread flavor, can't remember the name.) If you want to truly globally catch a managed exception you do need to install an SEH filter. You're not going to get a System.Exception and if you want a callstack you're going to have to roll your own walker.
In an MSDN forum question on this topic it was suggested to override a sufficiently low-level point of the main MFC thread in a try ... catch (Exception^). For instance, CWinApp::Run. This may be a good solution but I haven't looked at any perf or stability implications. You'll get a chance to log with a call stack before you bail and you can avoid the default windows unahndled exception behavior.
Taking a look around the internets, you'll find that you need to install a filter to get the unmanaged exceptions passing the filters on their way to your AppDomain. From CLR and Unhandled Exception Filters:
The CLR relies on the SEH unhandled exception filter mechanism to catch unhandled exceptions.
Using those two exception handlers should work.
Why "should?"
The events are not raised using the below:
extern "C" void wWinMainCRTStartup();
// managed entry point
[System::STAThread]
int managedEntry( void )
{
FinalExceptionHandler^ handler = gcnew FinalExceptionHandler();
Application::ThreadException += gcnew System::Threading::ThreadExceptionEventHandler(
handler,
&FinalExceptionHandler::OnThreadException);
AppDomain::CurrentDomain->UnhandledException += gcnew UnhandledExceptionEventHandler(
handler,
&FinalExceptionHandler::OnAppDomainException);
wWinMainCRTStartup();
return 0;
}
// final thread exception handler implementation
void FinalExceptionHandler::OnThreadException( Object^ /* sender */, System::Threading::ThreadExceptionEventArgs^ t )
{
LogWrapper::log->Error( "Unhandled managed thread exception.", t->Exception );
}
// final appdomain exception handler implementation
void FinalExceptionHandler::OnAppDomainException(System::Object ^, UnhandledExceptionEventArgs ^args)
{
LogWrapper::log->Error( "Unhandled managed appdomain exception.", (Exception^)(args->ExceptionObject) );
}
BOOL CMyApp::InitInstance()
{
throw gcnew Exception("test unhandled");
return TRUE;
}
Using those two exception handlers should work. Are you sure you've added them in a place where they're going to be called and properly set (ie, in your application's managed entry point -- you did put one in, right?)