Backendless Support
 
Need Answer

APP INITIALIZATION PROBLEM

Hi guys i am building a windows phone 8.1 project and i have problem with app initialization. When i run the application it throws me this

An exception of type 'System.TypeInitializationException' occurred in Backendless.ni.DLL but was not handled in user code

Here is my code in MainPage.xaml.cs

using BackendlessAPI;

using BackendlessAPI.Async;

using System;

using System.Collections.Generic;

using System.IO;

using System.Linq;

using System.Runtime.InteropServices.WindowsRuntime;

using System.Windows;

using Windows.Foundation;

using Windows.Foundation.Collections;

using Windows.UI.Core;

using Windows.UI.Popups;

using Windows.UI.Xaml;

using Windows.UI.Xaml.Controls;

using Windows.UI.Xaml.Controls.Primitives;

using Windows.UI.Xaml.Data;

using Windows.UI.Xaml.Input;

using Windows.UI.Xaml.Media;

using Windows.UI.Xaml.Navigation;

namespace Proximity

{

public sealed partial class MainPage : Page

{

public MainPage()

{

this.InitializeComponent();

//this.NavigationCacheMode = NavigationCacheMode.Required;

this.Loaded += new RoutedEventHandler(MainPage_Loaded);

}

void MainPage_Loaded(object sender, RoutedEventArgs e)

{

if (string.IsNullOrEmpty(Initialize.APPLICATION_ID) || string.IsNullOrEmpty(Initialize.SECRET_KEY))

{

Frame.Navigate(typeof(ErrorPage));

return;

}

Backendless.InitApp(Initialize.APPLICATION_ID, Initialize.SECRET_KEY);

}

protected override void OnNavigatedTo(NavigationEventArgs e)

{

}

private async void LoginButton_Click(object sender, RoutedEventArgs e)

{

if (string.IsNullOrEmpty(EmailField.Text) || string.IsNullOrEmpty(PasswordField.Password))

{

MessageDialog messageDialog = new MessageDialog("Enter your email and password");

await messageDialog.ShowAsync();

return;

}

Backendless.UserService.Login(EmailField.Text, PasswordField.Password,

new AsyncCallback<BackendlessUser>(

response =>

{

Frame.Navigate(typeof(LoggedInPage));

},

async fault =>

{

MessageDialog messageDialog = new MessageDialog(fault.Message);

await messageDialog.ShowAsync();

}));

}

private void RegisterButton_Click(object sender, RoutedEventArgs e)

{

Frame.Navigate(typeof(RegistrationPage));

}

}

}