Anvesha Mathur
Anvesha Mathur

Reputation: 11

'Cannot find type System.Resources.ResourceSet in module mscorlib.dll' in windows phone 8.1 app

private void LoginButton_Click(object sender, RoutedEventArgs e)
{
     if(username.Text == "")           
          MessageBox.Show("Enter username");
     else if (password.Password == "")            
          MessageBox.Show("Enter password");
     else if (username.Text == "anve" && password.Password == "123")
     {
          MessageBox.Show("Success !");
          Frame.Navigate(typeof(List));
     }
     else
          MessageBox.Show("Enter Valid Credentials");            
}

I'm creating a login page for my app. I have added the System.Windows.Forms reference and used the MessageBox.Show. But it is giving an error "Cannot find type System.Resources.ResourceSet in module mscorlib.dll".

Upvotes: 0

Views: 1572

Answers (1)

Konrad Bartecki
Konrad Bartecki

Reputation: 448

You can't use Windows.Forms namespace in Windows Phone 8.1 projects.

Use MessageDialog instead

private async void ShowMessageDialog()
{
   MessageDialog msgbox = new MessageDialog("Hello!"); 
   await msgbox.ShowAsync();  
}

or shorter version

await new MessageDialog("Hello!").ShowAsync();

Upvotes: 3

Related Questions