none
Authentication Problem

    Question

  • Hi,

     I've written an SL3 application and I'm using the new Authentication Service to let users log into the application.

    It works fine when I run it locally, but when I publish the application to my web server it throws me an error.

    Here's the details

     The specified resource was not found

       at System.Windows.Ria.Data.HttpDomainClient.GetRequestResult(HttpWebRequest request, IAsyncResult asyncResult)
       at System.Windows.Ria.Data.HttpDomainClient.EndInvokeCore(IAsyncResult asyncResult)
       at System.Windows.Ria.Data.DomainClient.EndInvoke(IAsyncResult asyncResult)
       at System.Windows.Ria.Data.DomainContext.<>c__DisplayClass1f.<InvokeServiceOperation>b__1d(IAsyncResult asyncResult)

    Anyone have any idea why this isn't working on my web server ?

    Does the web server need to have something extra installed to support .Net RIA or SL3 ?

    Thanks,

    Sunday, April 05, 2009 8:33 AM

All replies

  • Did you publish the RIA Service dlls? Besides that you'll need to add a handler in the web.config. Add this in the Handlers section of your web.config:


    <add path="DataService.axd" verb="GET,POST" type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    Sunday, April 05, 2009 3:10 PM
  • Mark,

    Thanks for the Reply.

    The line is already in the Web.Config file.

    And when I look at the bin folder on my webserver the dlls are there - here's a couple

    System.Web.Ria.dll
    System.Web.DomainServices.dll
    System.Web.DomainServices.Providers.dll

    Any other ideas ??

     

    Also, just so you have a background.
    I'm just publishing the web application as I always would.
    I've disable the login screen and the application works fine, it only throws an error when I use te Login screen.

    Here's the login code I'm using

      

                if (!UserService.Current.IsBusy)
                {
                    UserService.Current.Login(txtUsername.Text, txtPassword.Password);
                    UserService.Current.LoginCompleted += new EventHandler(Current_LoginCompleted);
                    gStatus.Visibility = Visibility.Visible;
                }
     

     

    Sunday, April 05, 2009 3:14 PM
  • Hi,

    Hmm, sorry I'm now out of ideas.

    Monday, April 06, 2009 1:51 AM
  • Are any of your domain services functional in the published application? The exception you're getting is generic for all the services. Also, what does your EnableClientAccessAttribute look like?

    Kyle

    Monday, April 06, 2009 11:12 AM
  • Just tested it with using the LinqToSqlDomainService and it returned the same error :

    The specified resource was not found

       at System.Windows.Ria.Data.HttpDomainClient.GetRequestResult(HttpWebRequest request, IAsyncResult asyncResult)
       at System.Windows.Ria.Data.HttpDomainClient.EndQueryCore(IAsyncResult asyncResult)
       at System.Windows.Ria.Data.DomainClient.EndQuery(IAsyncResult asyncResult)
       at System.Windows.Ria.Data.DomainContext.GetQueryResults(DomainClient client, Object loadContextKey, IAsyncResult asyncResult)
       at System.Windows.Ria.Data.DomainContext.CompleteLoad(IAsyncResult asyncResult)

    The EnableClientAccess attribute looks just like this

     [EnableClientAccess()]

    Any thoughts ??

    Monday, April 06, 2009 11:31 AM
  • What does is the fiddler output look like?

    Monday, April 06, 2009 2:22 PM
  • I've installed Fiddler - but I'm not sure what I should be looking for.

    The test website is http://test.codeworksmedia.com/slmediatooltestpage.aspx

    If you click on the third icon on the left, it should load a list of files...You can see the error there...

    Here's the session information from fiddler - not sure if it's what you're looking for.

    GET /ClientBin/DataService.axd/SLMediaTool-Web-FilesDomainService/GetFiles HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2; MS-RTC LM 8)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=Ju4hpHLsyQEkAAAAMjU4OTYzMDEtNGQwMS00MTk2LWJmZmUtZGYxYTlkMWVkNDA3kDvvkIQfQuicd9N6Kr2Bd1hHnoo1; .ASPXANONYMOUS=PvYl6nvsyQEkAAAAMjUzZDU5MzktMDA2My00MWVjLWE2MDctOGI5ZDliZjg4ODBk_WFy_yX6ekNB6K0t3iKr-0gSbL41


    HTTP/1.1 500 Internal Server Error
    Date: Mon, 06 Apr 2009 18:42:03 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 3026

    <html>
    <head>
    <title>Runtime Error</title>
    <style>
    body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
    p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
    b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
    H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
    H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
    pre {font-family:"Lucida Console";font-size: .9em}
    .marker {font-weight: bold; color: black;text-decoration: none;}
    .version {color: gray;}
    .error {margin-bottom: 10px;}
    .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
    </style>
    </head>

    <body bgcolor="white">

    <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

    <h2> <i>Runtime Error</i> </h2></span>

    <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

    <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    <br><br>

    <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>

    <table width=100% bgcolor="#ffffcc">
    <tr>
    <td>
    <code><pre>

    &lt;!-- Web.Config Configuration File --&gt;

    &lt;configuration&gt;
    &lt;system.web&gt;
    &lt;customErrors mode=&quot;Off&quot;/&gt;
    &lt;/system.web&gt;
    &lt;/configuration&gt;</pre></code>

    </td>
    </tr>
    </table>

    <br>

    <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application's &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>

    <table width=100% bgcolor="#ffffcc">
    <tr>
    <td>
    <code><pre>

    &lt;!-- Web.Config Configuration File --&gt;

    &lt;configuration&gt;
    &lt;system.web&gt;
    &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;
    &lt;/system.web&gt;
    &lt;/configuration&gt;</pre></code>

    </td>
    </tr>
    </table>

    <br>

    </body>
    </html>

     Any chance you can help me ??

    Monday, April 06, 2009 2:50 PM
  • <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    <br><br>

    <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>

    &lt;!-- Web.Config Configuration File --&gt;

    &lt;configuration&gt;
    &lt;system.web&gt;
    &lt;customErrors mode=&quot;Off&quot;/&gt;
    &lt;/system.web&gt;
    &lt;/configuration&gt;</pre></code>

    Give this a try and see what the actual error is. Also, I just want to confirm you have the DataService.axd handler in both system.web and system.webServer sections.

    Monday, April 06, 2009 3:27 PM
  • Here's the actual error -

    GET /ClientBin/DataService.axd/SLMediaTool-Web-FilesDomainService/GetFiles HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2; MS-RTC LM 8)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=Ju4hpHLsyQEkAAAAMjU4OTYzMDEtNGQwMS00MTk2LWJmZmUtZGYxYTlkMWVkNDA3kDvvkIQfQuicd9N6Kr2Bd1hHnoo1; .ASPXANONYMOUS=XCz1CoftyQEkAAAAZGVmMmYwMzAtNGM3Ny00ODdiLTk2NGYtYWViZTE4ODU5NTgyH9iGELkNNqGMcnsBZii7LcwafQQ1


    HTTP/1.1 500 Internal Server Error
    Date: Mon, 06 Apr 2009 20:21:10 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 5723

    <html>
    <head>
    <title>Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.</title>
    <style>
    body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
    p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
    b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
    H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
    H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
    pre {font-family:"Lucida Console";font-size: .9em}
    .marker {font-weight: bold; color: black;text-decoration: none;}
    .version {color: gray;}
    .error {margin-bottom: 10px;}
    .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
    </style>
    </head>

    <body bgcolor="white">

    <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

    <h2> <i>Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.</i> </h2></span>

    <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

    <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    <br><br>

    <b> Exception Details: </b>System.TypeLoadException: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.<br><br>

    <b>Source Error:</b> <br><br>

    <table width=100% bgcolor="#ffffcc">
    <tr>
    <td>
    <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

    </td>
    </tr>
    </table>

    <br>

    <b>Stack Trace:</b> <br><br>

    <table width=100% bgcolor="#ffffcc">
    <tr>
    <td>
    <code><pre>

    [TypeLoadException: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
    System.Windows.Ria.Linq.Utility.IsSerializableDataMember(PropertyDescriptor propertyDescriptor, Boolean isEntity) +0
    System.Web.Ria.&lt;&gt;c__DisplayClass4.&lt;Serialize&gt;b__2(PropertyDescriptor p) +13
    System.Linq.&lt;WhereIterator&gt;d__0`1.MoveNext() +185
    System.Web.Ria.EntityConverter.Serialize(Object obj, JavaScriptSerializer serializer) +378
    System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +102
    System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) +59
    System.Web.Ria.DataServiceResponse.Send(Object result, DomainService domainService) +211
    System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +450
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64
    </pre></code>

    </td>
    </tr>
    </table>

    <br>

    <hr width=100% size=1 color=silver>

    <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

    </font>

    </body>
    </html>
    <!--
    [TypeLoadException]: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
    at System.Windows.Ria.Linq.Utility.IsSerializableDataMember(PropertyDescriptor propertyDescriptor, Boolean isEntity)
    at System.Web.Ria.EntityConverter.<>c__DisplayClass4.<Serialize>b__2(PropertyDescriptor p)
    at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext()
    at System.Web.Ria.EntityConverter.Serialize(Object obj, JavaScriptSerializer serializer)
    at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
    at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj)
    at System.Web.Ria.DataServiceResponse.Send(Object result, DomainService domainService)
    at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

     

    Monday, April 06, 2009 4:23 PM
  • [TypeLoadException]: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    Do you have the System.Runtime.Serialization assembly published?

    Monday, April 06, 2009 5:06 PM
  • Thanks for the help kylemc - I think it's a problem with VS.

    Been crashing on me lately - think my computer needs a cleaning :)

     

    Check out this post for some extra info on it http://forums.asp.net/p/969839/1371338.aspx

    Monday, April 06, 2009 6:47 PM
  • OK - I can't for the life of me figure this out...

    I've restored my computer to when I first built it - re-installed the Silverlight 3 beta SDK, Silverlight Toolkit, .Net RIA Services.

    Created a new application connecting to my database and displaying the results in a ListBox.

    Again, it works locally no problems, but when I publish it to my webserver, it gives me the same error.
    I've checked in the Silverlight project and the System.Runtime.Serialization dll is referenced, but it continues to give me the same error.

    Do I need an access policy, or a cross domain file - don't need them on the local machine, and I'm connecting to a database on my webserver, so I can't see the problem.

    Does anyone have any ideas, or has anyone got it to work successfully on THEIR web server ? 

     The link to the new project is http://test.codeworksmedia.com/OnlineDomainContextTestTestPage.aspx

     

    One thing I did notice is that even though the System.Runtime.Serialization file is referenced in the SL app, it's not included in the XAP file.
    So I went into the properties and set Copy Local to True, and Specific Version to True - which matched the RIA dll properties.
    The file was included in the XAP this time - I published the application but I still get the same error.

     

    ANYONE :)

     

    Here's the Fiddler error again -

    GET /ClientBin/DataService.axd/OnlineDomainContextTest-Web-FileDomainService/GetTbl_pinglogs HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=WqUSlrHuyQEkAAAANTU5N2FmNmUtMjNkZi00NTA2LTkxMmYtMWI5ODA5NGJjMTA2pNpKYoSn0sDDwUA1cbVCEwas6xo1


    HTTP/1.1 500 Internal Server Error
    Date: Wed, 08 Apr 2009 08:46:28 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 5723

    <html>
        <head>
            <title>Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>

        <body bgcolor="white">

                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

                <h2> <i>Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.</i> </h2></span>

                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

                <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                <br><br>

                <b> Exception Details: </b>System.TypeLoadException: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.<br><br>

                <b>Source Error:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                      </td>
                   </tr>
                </table>

                <br>

                <b>Stack Trace:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>

    [TypeLoadException: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.Windows.Ria.Linq.Utility.IsSerializableDataMember(PropertyDescriptor propertyDescriptor, Boolean isEntity) +0
       System.Web.Ria.&lt;&gt;c__DisplayClass4.&lt;Serialize&gt;b__2(PropertyDescriptor p) +13
       System.Linq.&lt;WhereIterator&gt;d__0`1.MoveNext() +185
       System.Web.Ria.EntityConverter.Serialize(Object obj, JavaScriptSerializer serializer) +378
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +102
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) +59
       System.Web.Ria.DataServiceResponse.Send(Object result, DomainService domainService) +211
       System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +450
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64
    </pre></code>

                      </td>
                   </tr>
                </table>

                <br>

                <hr width=100% size=1 color=silver>

                <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

                </font>

        </body>
    </html>
    <!--
    [TypeLoadException]: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
       at System.Windows.Ria.Linq.Utility.IsSerializableDataMember(PropertyDescriptor propertyDescriptor, Boolean isEntity)
       at System.Web.Ria.EntityConverter.<>c__DisplayClass4.<Serialize>b__2(PropertyDescriptor p)
       at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext()
       at System.Web.Ria.EntityConverter.Serialize(Object obj, JavaScriptSerializer serializer)
       at System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat)
       at System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj)
       at System.Web.Ria.DataServiceResponse.Send(Object result, DomainService domainService)
       at System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

    Wednesday, April 08, 2009 4:58 AM
  • If anyone has an application that's working fine on their webserver and wouldn't mind trying it on mine, please let me know. Maybe we can upload it to mine and see if the problem lies there.

     Thanks :-)

    IJ

    Wednesday, April 08, 2009 5:07 AM
  • I think the System.Runtime.Serialization assembly you're interested in is the one on the server side. The error occurs while trying to deserialize your entity in the service. The assembly in the xap shouldn't affect this.

    Kyle

    Wednesday, April 08, 2009 10:07 AM
  • I'll reference it in the Web Application and give it a try - cheers

    Wednesday, April 08, 2009 10:14 AM
  • Exactly the same error comes up :(

    Wednesday, April 08, 2009 10:18 AM
  • What if you manually copy it to the bin?

    Wednesday, April 08, 2009 1:55 PM
  • Hey - I copied it up and got this message

    But it still works on my local machine, which is weird...

     

    GET /ClientBin/DataService.axd/SLMediaTool-Web-FilesDomainService/GetFiles HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=WqUSlrHuyQEkAAAANTU5N2FmNmUtMjNkZi00NTA2LTkxMmYtMWI5ODA5NGJjMTA2pNpKYoSn0sDDwUA1cbVCEwas6xo1


    HTTP/1.1 500 Internal Server Error
    Date: Wed, 08 Apr 2009 20:03:05 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 8673

    <html>
        <head>
            <title>Object reference not set to an instance of an object.</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>

        <body bgcolor="white">

                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

                <h2> <i>Object reference not set to an instance of an object.</i> </h2></span>

                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

                <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                <br><br>

                <b> Exception Details: </b>System.NullReferenceException: Object reference not set to an instance of an object.<br><br>

                <b>Source Error:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                      </td>
                   </tr>
                </table>

                <br>

                <b>Stack Trace:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>

    [NullReferenceException: Object reference not set to an instance of an object.]
       SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:95

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
       System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime) +20
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime) +24
       System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance) +51
       System.ComponentModel.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes() +65
       System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) +26
       System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType) +444
       System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception&amp; error) +3030
       System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +467
       System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +386
       System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime) +422
       System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime) +16
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +221

    [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +268
       System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +83
       System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175
       System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +161
    </pre></code>

                      </td>
                   </tr>
                </table>

                <br>

                <hr width=100% size=1 color=silver>

                <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

                </font>

        </body>
    </html>
    <!--
    [NullReferenceException]: Object reference not set to an instance of an object.
       at SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:line 95
    [TargetInvocationException]: Exception has been thrown by the target of an invocation.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance)
       at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
       at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
       at System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType)
       at System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception& error)
       at System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime)
       at System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime)
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
    [HttpException]: Exception has been thrown by the target of an invocation.
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
       at System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
       at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

    Wednesday, April 08, 2009 4:16 PM
  • [NullReferenceException]: Object reference not set to an instance of an object.
       at SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:line 95

    What's the constructor look like where it's throwing the NullReferenceException?

    Wednesday, April 08, 2009 4:38 PM
  • I already checked it out, It's the contstructor in the Linq to SQL file.

    Why would it work fine on my machine, and not on the web server.

    I also just copied all the dlls that are referenced in the project and it still doesn't work...

     This is doin my head in... >:|

    Same error message

    GET /ClientBin/DataService.axd/SLMediaTool-Web-FilesDomainService/GetFiles HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=WqUSlrHuyQEkAAAANTU5N2FmNmUtMjNkZi00NTA2LTkxMmYtMWI5ODA5NGJjMTA2pNpKYoSn0sDDwUA1cbVCEwas6xo1


    HTTP/1.1 500 Internal Server Error
    Date: Wed, 08 Apr 2009 22:22:38 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 8673

    <html>
        <head>
            <title>Object reference not set to an instance of an object.</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>

        <body bgcolor="white">

                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

                <h2> <i>Object reference not set to an instance of an object.</i> </h2></span>

                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

                <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                <br><br>

                <b> Exception Details: </b>System.NullReferenceException: Object reference not set to an instance of an object.<br><br>

                <b>Source Error:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                      </td>
                   </tr>
                </table>

                <br>

                <b>Stack Trace:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>

    [NullReferenceException: Object reference not set to an instance of an object.]
       SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:95

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
       System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime) +20
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime) +24
       System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance) +51
       System.ComponentModel.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes() +65
       System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) +26
       System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType) +444
       System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception&amp; error) +3030
       System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +467
       System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +386
       System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime) +422
       System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime) +16
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +221

    [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +268
       System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +83
       System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175
       System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +161
    </pre></code>

                      </td>
                   </tr>
                </table>

                <br>

                <hr width=100% size=1 color=silver>

                <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

                </font>

        </body>
    </html>
    <!--
    [NullReferenceException]: Object reference not set to an instance of an object.
       at SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:line 95
    [TargetInvocationException]: Exception has been thrown by the target of an invocation.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance)
       at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
       at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
       at System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType)
       at System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception& error)
       at System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime)
       at System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime)
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
    [HttpException]: Exception has been thrown by the target of an invocation.
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
       at System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
       at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

    Wednesday, April 08, 2009 6:23 PM
  • I already checked it out, It's the contstructor in the Linq to SQL file.

    Why would it work fine on my machine, and not on the web server.

    I also just copied all the dlls that are referenced in the project and it still doesn't work...

     This is doin my head in... >:|

    Same error message

    GET /ClientBin/DataService.axd/SLMediaTool-Web-FilesDomainService/GetFiles HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2)
    Host: test.codeworksmedia.com
    Connection: Keep-Alive
    Cookie: .ASPXANONYMOUS=WqUSlrHuyQEkAAAANTU5N2FmNmUtMjNkZi00NTA2LTkxMmYtMWI5ODA5NGJjMTA2pNpKYoSn0sDDwUA1cbVCEwas6xo1


    HTTP/1.1 500 Internal Server Error
    Date: Wed, 08 Apr 2009 22:22:38 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 8673

    <html>
        <head>
            <title>Object reference not set to an instance of an object.</title>
            <style>
             body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
             p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
             b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
             H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
             H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
             pre {font-family:"Lucida Console";font-size: .9em}
             .marker {font-weight: bold; color: black;text-decoration: none;}
             .version {color: gray;}
             .error {margin-bottom: 10px;}
             .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
            </style>
        </head>

        <body bgcolor="white">

                <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

                <h2> <i>Object reference not set to an instance of an object.</i> </h2></span>

                <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

                <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                <br><br>

                <b> Exception Details: </b>System.NullReferenceException: Object reference not set to an instance of an object.<br><br>

                <b>Source Error:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                      </td>
                   </tr>
                </table>

                <br>

                <b>Stack Trace:</b> <br><br>

                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>

    [NullReferenceException: Object reference not set to an instance of an object.]
       SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:95

    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&amp; canBeCached, RuntimeMethodHandle&amp; ctor, Boolean&amp; bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
       System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime) +20
       System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime) +24
       System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance) +51
       System.ComponentModel.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes() +65
       System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) +26
       System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType) +444
       System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception&amp; error) +3030
       System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +467
       System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry&amp; method) +386
       System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime) +422
       System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime) +16
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +221

    [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
       System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context) +268
       System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +83
       System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175
       System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +161
    </pre></code>

                      </td>
                   </tr>
                </table>

                <br>

                <hr width=100% size=1 color=silver>

                <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

                </font>

        </body>
    </html>
    <!--
    [NullReferenceException]: Object reference not set to an instance of an object.
       at SLMediaTool.Web.DataAccess.MediaToolDBDataContext..ctor() in G:\Documents\Visual Studio 2008\Projects\SilverlightProjects\SLMediaTool\SLMediaTool.Web\DataAccess\MediaToolDB.designer.cs:line 95
    [TargetInvocationException]: Exception has been thrown by the target of an invocation.
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlDomainService.CreateAndInitializeContext(Boolean isDesignTime)
       at System.Web.DomainServices.LinqToSql.LinqToSqlTypeDescriptionProvider.GetTypeDescriptor(Type objectType, Object instance)
       at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
       at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
       at System.Web.DomainServices.DomainServiceDescription.AddEntityType(Type entityType)
       at System.Web.DomainServices.DomainServiceDescription.IsValidMethodSignature(MethodInfo methodInfo, DomainOperation operation, Exception& error)
       at System.Web.DomainServices.DomainServiceDescription.TryGetImplicitDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.TryGetDomainOperation(MethodInfo methodInfo, DomainOperationEntry& method)
       at System.Web.DomainServices.DomainServiceDescription.GetDescriptionInternal(Object domainServiceTypeOrInstance, Boolean isDesignTime)
       at System.Web.DomainServices.DomainServiceDescription.GetDescription(Type domainServiceType, Boolean isDesignTime)
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
    [HttpException]: Exception has been thrown by the target of an invocation.
       at System.Web.Ria.DataServiceFactory.GetDataService(HttpContext context)
       at System.Web.Ria.DataServiceFactory.System.Web.IHttpHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
       at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

    Wednesday, April 08, 2009 6:23 PM
  • Yeah, now that it's successfully linking, I think we're on to a different problem. I wonder if your deployed application is having trouble accessing your database. Judging by some sample L2S designer files, it looks like a NullReferenceException could occur when trying to access the connection string from your default settings. Is the connection string valid once your application is deployed?

    Wednesday, April 08, 2009 6:52 PM
  • Yeah - it's the same connection string I use for my website and it's working no problem.

     How can I check - I opened the web.config that's on the server and it's the same.

    I published that app again and cleared my cache and it's gone back to the serialization error even though all the dlls are on the server..this is frustrating..

    Has anyone successfully published a silverlight application to their web server ??

    Is there a way for me to test the .Net RIA Services using some other means ??

     

    BTW - thanks for all your help KyleMc

    Wednesday, April 08, 2009 7:11 PM
  • Is there any way you could share your project?

    By looking at the callstack I strongly suspect it has to do with the connection string setting variable is null for some reason.

    Have you tried setting break point on the constructor and seeing exactly what is causing the NullReference exception?

    Wednesday, April 08, 2009 9:02 PM
  • Problem is that the account defined in your application pole for your web site on the web server has to have access to your database.

    Had the same problem when publishing on an internal server.

    Good luck :)

    Thursday, April 09, 2009 4:07 PM
  • Any chance you can go into a bit more detail - not sure I understand !

    What's an Application Pole ?

    Where would I find it in the website admin panel - I'm using DotNetPanel.

    I just created a new sub-domain and this is where I'm publishing it, maybe that's the reason it's not working. It is working on the main website that the sub-domain is under.

    Thanks for the info - I'll have a look into it :)

    Thursday, April 09, 2009 4:22 PM
  • Sorry for the typo, i meant the application pool and more precise the identity used in this application pool has to have access to your database server.

    You can see this in the advanced setting on the application pool in IIS Manager.

    Good luck

    Thursday, April 09, 2009 4:38 PM
  • I can't actually get on to the web server, it's a hosted server.

    I'll have to have chat with support and see if they can see anything wrong.

     

    Thanks for the info :)

    Thursday, April 09, 2009 5:36 PM
  • I published that application to my main domain which works fine with no problems.

    Still didn't work - getting the same error message about the Serialization...

     

    Has anyone created an application that uses .Net RIA services that I can have a look at and upload to see if it's my application or the web server..

    Tuesday, April 14, 2009 9:38 AM
  • You could test out one of the samples found here (http://code.msdn.microsoft.com/RiaServices).

    Tuesday, April 14, 2009 10:45 AM
  • --duplicate post--

    Wednesday, April 29, 2009 10:59 AM
  • Hi IrishJoker,

    Did you find a solution?

    I'm getting the exact same error when I deploy my solution to a GoDaddy.com hosting account while it's working fine on my local machine:

    TypeLoadException: Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.Windows.Ria.Linq.Utility.IsSerializableDataMember(PropertyDescriptor propertyDescriptor, Boolean isEntity) +0
       System.Web.Ria.&lt;&gt;c__DisplayClass4.&lt;Serialize&gt;b__2(PropertyDescriptor p) +13
       System.Linq.&lt;WhereIterator&gt;d__0`1.MoveNext() +185
       System.Web.Ria.EntityConverter.Serialize(Object obj, JavaScriptSerializer serializer) +378
       System.Web.Script.Serialization.JavaScriptSerializer.SerializeValue(Object o, StringBuilder sb, Int32 depth, Hashtable objectsInUse, SerializationFormat serializationFormat) +102
       System.Web.Script.Serialization.JavaScriptSerializer.Serialize(Object obj) +59
       System.Web.Ria.DataServiceResponse.Send(Object result, DomainService domainService) +211
       System.Web.Ria.DataService.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +450
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64

    Wednesday, April 29, 2009 10:59 AM
  • I'm afraid not - haven't gotten anywhere - haven't had a look at it in a while

    I create an application using the northwind database in the App_Folder, but it still gave me the error.

    I've even copied over all the dlls referenced in the project, but I still can't get anywhere.

     

    If you've any luck - give us a shout :-) I'll try to take a look at it when I get a free minute :D

    Wednesday, April 29, 2009 11:07 AM
  • I was having a quick look around and I noticed that the website http://silverlightshow.net have a demo doing the exact same thing we're trying to do - and they're gotten it working no problem.

    Also, the Whois on the domain says that it's registered through GoDaddy - might be using their web hosting too - maybse something for you to look into.

    If ya find out anything, let us know :-)

    Here's the link to the article 

    http://www.silverlightshow.net/items/Creating-application-with-.NET-RIA-Services-Part-5-Sorting-and-Filtering-data.aspx

    And the Demo

    http://www.silverlightshow.net/showcase/webadministrationtool/default.aspx#/Home.xaml

    Wednesday, April 29, 2009 11:21 AM
  • Was talking to Tim Heuer and he's been talking to the .Net RIA Services team, and what they've told him is that at the moment the .Net RIA services run in full trust mode.

    So I think that's the problem that we're comin up against.

    At least we have an answer - cheers Tim :-)

    Wednesday, April 29, 2009 1:05 PM
  • It looks like the problem is fixed in the May 2009 preview release. At least my (sample) application seems to be working now.

    Friday, May 15, 2009 4:25 PM
  • I've modified an existing RIA sample and posted it here on a web server I have full control over.. I'm getting the exact same error and also stumpted as to a solution.

     That error again being:

    Could not load type 'System.Runtime.Serialization.IgnoreDataMemberAttribute' from assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    My app is posted here.

    http://www.fitnessmentor.co.nz:8888/Fitmentor.aspx#/Home 

    I get a slightly differnet error if I change from Windows authentication to forms on the server but I'm not sure what either means.  The server has .net 3.5 SP1 on it, although I noticed a couple of slight differences in version numbers between my dev machine and the server.  On those dll's I tried CopyLocal=true but that didn't seem to make any difference.

    system.runtime.serialization.dll 

    3.0.4506.4037  dev machine

    3.0.4506.648 server

     

    system.web.extensions.dll

    3.5.30729.196 dev

    3.5.21022.8 server

      

    any ideas?

    Wednesday, July 29, 2009 4:56 AM
  •  I have had  the same situation.

    You should install  . net 3.0 sp 2.0

    The assembly  System.Runtime.Serialization in  . net 3.0 sp 1.0 doesn't have class IgnoreDataMemberAttribute.

    I hope it will help.

     

    Wednesday, August 12, 2009 9:11 AM