title: IIS7 Hosting Silverlight Application
body: <p>I have made a Silverlight Application WCF RIA Services which have's a login page that verify the username and password in a database ... it has worked perfectly when I debug from VS2010 but when I publish to IIS7 it doesn't connect with database any more ... I've made all the settings in the Web.config ... I've added the clientaccesspolicy.xml and crossdomain.xml to my project ... added the MIME types to IIS7  with no result ... I find an error with development tools from IE9 and it says :</p>
  
  <pre><code>SCRIPT5022: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
     at MaG.ServiceReference1.LoginCompletedEventArgs.get_Result()
     at MaG.MainPage.connection_LoginCompleted(Object sender, LoginCompletedEventArgs e)
     at MaG.ServiceReference1.Service1Client.OnLoginCompleted(Object state) 
  MaGTestPage.html, line 1 character 1
  </code></pre>
  
  <p>I appeal the Login method client to webservice like this:</p>
  
  <pre><code>try
     {
        ServiceReference1.Service1Client connection = new ServiceReference1.Service1Client();              
        connection.LoginCompleted += new EventHandler&lt;ServiceReference1.LoginCompletedEventArgs&gt;(connection_LoginCompleted);
        connection.LoginAsync(textBox1.Text, passwordBox1.Password);
     }
        catch (Exception ex)
     {
        Console.Write(ex.InnerException);
     }
  </code></pre>