Silverlight / Ria "could not load file or assembly"

Discussion in 'Silverlight' started by rferraiolic, Feb 27, 2010.

  1. I am trying to deploy a Silverlight Ria application and am getting the following error in fiddler:

    Could not load file or assembly 'System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</title>


    I am confused by this error because I have set System.Web.Ria to CopyLocal=True. I see the file is located in the /bin folder. When I load up the application on the server I get the infamous Load Operation Failed for Query 'Get User'. :(

    Has anyone resolved this type of issue? Thanks.
     
  2. I'm still trying to figure this out. I noticed that in fiddler the POST is looking here...

    POST /ClientBin/MyBusinessApplication-Web-AuthenticationService.svc/binary HTTP/1.1

    but the only file in my ClientBin is the xap file. When I test the service I use the following URL:

    http://www.mydomain.com/virDir/MyBusinessApplication-Web-AuthenticationService.svc

    Do I need to create the svc files? I thought that was all pre-wired???

    Thanks!
     
  3. I got this error trace from IIS. Line 57 is where the error happens. Something about ASPNetInitializationModule...

    No. EventName Details Time
    1. i GENERAL_REQUEST_START SiteId="702490", AppPoolId="customerPool_702490", ConnId="1610721275", RawConnId="0", RequestURL="http://www.domain.com:80/ClientBin/MyBusinessApplication-Web-AuthenticationService.svc/binary", RequestVerb="POST" 19:49:11.593
    2. — PRE_BEGIN_REQUEST_START ModuleName="RequestMonitorModule" 19:49:11.593
    3. — PRE_BEGIN_REQUEST_END ModuleName="RequestMonitorModule", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.593
    4. — PRE_BEGIN_REQUEST_START ModuleName="IsapiFilterModule" 19:49:11.593
    5. i FILTER_START FilterName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" 19:49:11.593
    6. i FILTER_PREPROC_HEADERS_START 19:49:11.593
    7. — GENERAL_SET_REQUEST_HEADER HeaderName="AspFilterSessionId", HeaderValue="", Replace="true" 19:49:11.593
    8. i FILTER_SET_REQ_HEADER HeaderName="AspFilterSessionId:", HeaderValue="" 19:49:11.593
    9. i FILTER_PREPROC_HEADERS_END 19:49:11.593
    10. i FILTER_END 19:49:11.593
    11. — PRE_BEGIN_REQUEST_END ModuleName="IsapiFilterModule", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.593
    12. — PRE_BEGIN_REQUEST_START ModuleName="FailedRequestsTracingModule" 19:49:11.593
    13. — PRE_BEGIN_REQUEST_END ModuleName="FailedRequestsTracingModule", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.593
    14. — PRE_BEGIN_REQUEST_START ModuleName="RewriteModule" 19:49:11.593
    15. — PRE_BEGIN_REQUEST_END ModuleName="RewriteModule", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.593
    16. — PRE_BEGIN_REQUEST_START ModuleName="RestfulUrlMapModule" 19:49:11.593
    17. — PRE_BEGIN_REQUEST_END ModuleName="RestfulUrlMapModule", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.593
    18. i GENERAL_REQUEST_HEADERS Headers="Cache-Control: no-cache
    Connection: Keep-Alive
    Content-Length: 267
    Content-Type: application/soap+msbin1
    Accept: */*
    Accept-Encoding: gzip, deflate
    Cookie: MyBusinessApplication-culture=en-US
    Host: www.domain.com
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    " 19:49:11.593
    19. i URL_CACHE_ACCESS_START RequestURL="/ClientBin/MyBusinessApplication-Web-AuthenticationService.svc/binary" 19:49:11.593
    20. i URL_CACHE_ACCESS_END PhysicalPath="", URLInfoFromCache="false", URLInfoAddedToCache="true", ErrorCode="The operation completed successfully.
    (0x0)" 19:49:11.593
    21. i GENERAL_GET_URL_METADATA PhysicalPath="", AccessPerms="513" 19:49:11.593
    22. i VIRTUAL_MODULE_UNRESOLVED Name="OutputCache", Type="System.Web.Caching.OutputCacheModule" 19:49:11.686
    23. i VIRTUAL_MODULE_UNRESOLVED Name="Session", Type="System.Web.SessionState.SessionStateModule" 19:49:11.686
    24. i VIRTUAL_MODULE_UNRESOLVED Name="WindowsAuthentication", Type="System.Web.Security.WindowsAuthenticationModule" 19:49:11.686
    25. i VIRTUAL_MODULE_UNRESOLVED Name="FormsAuthentication", Type="System.Web.Security.FormsAuthenticationModule" 19:49:11.686
    26. i VIRTUAL_MODULE_UNRESOLVED Name="DefaultAuthentication", Type="System.Web.Security.DefaultAuthenticationModule" 19:49:11.686
    27. i VIRTUAL_MODULE_UNRESOLVED Name="RoleManager", Type="System.Web.Security.RoleManagerModule" 19:49:11.686
    28. i VIRTUAL_MODULE_UNRESOLVED Name="UrlAuthorization", Type="System.Web.Security.UrlAuthorizationModule" 19:49:11.686
    29. i VIRTUAL_MODULE_UNRESOLVED Name="FileAuthorization", Type="System.Web.Security.FileAuthorizationModule" 19:49:11.686
    30. i VIRTUAL_MODULE_UNRESOLVED Name="AnonymousIdentification", Type="System.Web.Security.AnonymousIdentificationModule" 19:49:11.686
    31. i VIRTUAL_MODULE_UNRESOLVED Name="Profile", Type="System.Web.Profile.ProfileModule" 19:49:11.686
    32. i VIRTUAL_MODULE_UNRESOLVED Name="UrlMappingsModule", Type="System.Web.UrlMappingsModule" 19:49:11.686
    33. i VIRTUAL_MODULE_UNRESOLVED Name="ServiceModel", Type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 19:49:11.686
    34. i VIRTUAL_MODULE_UNRESOLVED Name="ScriptModule", Type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" 19:49:11.686
    35. i VIRTUAL_MODULE_UNRESOLVED Name="DomainServiceModule", Type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 19:49:11.686
    36. — NOTIFY_MODULE_START ModuleName="HttpCacheModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    37. — NOTIFY_MODULE_END ModuleName="HttpCacheModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    38. — NOTIFY_MODULE_START ModuleName="IpRestrictionModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    39. — NOTIFY_MODULE_END ModuleName="IpRestrictionModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    40. — NOTIFY_MODULE_START ModuleName="RequestFilteringModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    41. — NOTIFY_MODULE_END ModuleName="RequestFilteringModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    42. — NOTIFY_MODULE_START ModuleName="FailedRequestsTracingModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    43. — NOTIFY_MODULE_END ModuleName="FailedRequestsTracingModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    44. — NOTIFY_MODULE_START ModuleName="ConfigurationValidationModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    45. — NOTIFY_MODULE_END ModuleName="ConfigurationValidationModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    46. — NOTIFY_MODULE_START ModuleName="RewriteModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    47. — NOTIFY_MODULE_END ModuleName="RewriteModule", Notification="BEGIN_REQUEST", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    48. — NOTIFY_MODULE_START ModuleName="AspNetInitializationExceptionModule", Notification="BEGIN_REQUEST", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    49. i AspNetStart Data1="POST", Data2="/ClientBin/MyBusinessApplication-Web-AuthenticationService.svc", Data3="" 19:49:11.686
    50. — AspNetAppDomainEnter Data1="/LM/W3SVC/702490/ROOT/ClientBin-8-129118601515941141" 19:49:11.686
    51. — NOTIFY_MODULE_START ModuleName="IsapiFilterModule", Notification="MAP_PATH", fIsPostNotification="false", fIsCompletion="false" 19:49:11.686
    52. — NOTIFY_MODULE_END ModuleName="IsapiFilterModule", Notification="MAP_PATH", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 19:49:11.686
    53. — AspNetWebEventRaiseStart Data1="System.Web.Management.WebErrorEvent", Data2="3008", Data3="0" 19:49:11.686
    54. — AspNetWebEventDeliverStart Data1="EventLogProvider", Data2="All Errors Default", Data3="All Errors" 19:49:11.686
    55. — AspNetWebEventDeliverEnd 19:49:11.686
    56. — AspNetWebEventRaiseEnd 19:49:11.686
    57. r MODULE_SET_RESPONSE_ERROR_STATUS
    Warning ModuleName="AspNetInitializationExceptionModule", Notification="BEGIN_REQUEST", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The operation completed successfully.
    (0x0)", ConfigExceptionInfo="" 19:49:11.702
     
  4. Anybody? I'm really struggling with this. Is there anything one needs to do with the code itself to get the basic WCF RIA Services up and running on IIS 7? Is there anything that needs to be modified in IIS 7, i'm running with the default discountasp.net settings? Here is my web.config file if anybody has time to take a look...

    Code:
    <?xml version="1.0"?>
    <configuration>
      <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="Data Source=sql2k802.discountasp.net;Integrated Security=False;Initial Catalog=Server;User ID=Login;Password=pwd" providerName="System.Data.SqlClient"/>
      </connectionStrings>
      <system.web>
        <authorization>
          <allow roles="Admin" />
        </authorization>
        <globalization culture="auto"/>
        <membership defaultProvider="AspNetSqlMembershipProvider">
          <providers>
            <clear/>
            <add connectionStringName="LocalSqlServer"
                 name="AspNetSqlMembershipProvider"
                 enablePasswordRetrieval="false"
                 enablePasswordReset="true"
                 applicationName="/"
                 requiresUniqueEmail="false"
                 passwordFormat="Hashed"
                 maxInvalidPasswordAttempts="5"
                 minRequiredPasswordLength="6"
                 minRequiredNonalphanumericCharacters="0"
                 passwordAttemptWindow="10"
                 passwordStrengthRegularExpression=""
                 requiresQuestionAndAnswer="true"
                 type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
          </providers>
        </membership>
        <compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          </assemblies>
        </compilation>
        <authentication mode="Forms">
          <forms name=".MyBusinessApplication_ASPXAUTH"/>
        </authentication>
        <customErrors mode="Off">
    
        </customErrors>
        <roleManager enabled="true"
                     defaultProvider="AspNetSqlRoleProvider">
          <providers>
            <clear/>
            <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer"
                 type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
          </providers>
        </roleManager>
        
        <profile>
          <properties>
            <add name="FriendlyName"/>
          </properties>
        </profile>
        <pages>
          <controls>
            <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </controls>
        </pages>
        <httpHandlers>
          <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
          <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
          <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="DomainServiceModule" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </httpModules>
      </system.web>
      <system.codedom>
        <compilers>
          <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="v3.5"/>
            <providerOption name="WarnAsError" value="false"/>
          </compiler>
        </compilers>
      </system.codedom>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
          <remove name="ScriptModule"/>
          <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="DomainServiceModule" preCondition="managedHandler" type="System.Web.Ria.Services.DomainServiceHttpModule, System.Web.Ria, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </modules>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated"/>
          <remove name="ScriptHandlerFactory"/>
          <remove name="ScriptHandlerFactoryAppServices"/>
          <remove name="ScriptResource"/>
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
      </system.webServer>
    
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
            <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
          </dependentAssembly>
        	<dependentAssembly>
    				<assemblyIdentity name="System.ComponentModel.DataAnnotations" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
    				<bindingRedirect oldVersion="0.0.0.0-3.6.0.0" newVersion="3.6.0.0"/>
    			</dependentAssembly>
    		</assemblyBinding>
      </runtime>
      <system.serviceModel>
        <diagnostics>
          <messageLogging logEntireMessage="true" logMessagesAtServiceLevel="true"/>
        </diagnostics>
    
    
        <services>
    
          <service name="MyBusinessApplication.Web.AuthenticationService" behaviorConfiguration="RIAServiceBehavior">
            <endpoint address="" binding="wsHttpBinding" contract="MyBusinessApplication.Web.AuthenticationService"/>
            <endpoint address="/soap" binding="basicHttpBinding" contract="MyBusinessApplication.Web.AuthenticationService"/>
            <endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="MyBusinessApplication.Web.AuthenticationService"/>
          </service>
    
          <service name="MyBusinessApplication.Web.UserRegistrationService" behaviorConfiguration="RIAServiceBehavior">
            <endpoint address="" binding="wsHttpBinding" contract="MyBusinessApplication.Web.UserRegistrationService"/>
            <endpoint address="/soap" binding="basicHttpBinding" contract="MyBusinessApplication.Web.UserRegistrationService"/>
            <endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="MyBusinessApplication.Web.UserRegistrationService"/>
          </service>
        </services>
    
        <behaviors>
          <serviceBehaviors>
            <behavior name="RIAServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
    
        <bindings>
          <customBinding>
            <binding name="BinaryHttpBinding">
              <binaryMessageEncoding/>
              <httpTransport/>
            </binding>
          </customBinding>
        </bindings>
    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
          <!--<baseAddressPrefixFilters>
            <add prefix="http://www.domain.com"/>
          </baseAddressPrefixFilters>-->
        </serviceHostingEnvironment>
      </system.serviceModel>
    </configuration>
    
     
  5. I resolved the problem. I'm new to web development and my file structure was set up incorrectly, such that the /bin folder was at the same level as the application. Hence the unable to load System.Web.Ria assembly. For anyone who is having difficulty with setting up WCF Ria Services just download the binary from http://www.rajneeshnoonia.com/ under the WCF link. He has set up an application that has everything you need, just cut and paste. Regards,
    Rob
     
  6. mjp

    mjp

    Thanks for posting that follow-up Rob, and I'm glad you got it working!
     
  7. Hello Rob,

    Any hints for somebody like me who has little experience with WCF and Silverlight, but wants to experiment? Things like admin tasks, troubleshooting tips, configuration, etc.

    I downloaded the source and binary from the rajneeshnoonia.com site under his WCF link and will be studying it. I have a Sitefinity site up and running on DiscountASP.NET and want to branch out into some Silverlight with WCF RIA Services (eventually in version 4.0 with the .NET 4 framework).

    I have some resources available to me (books, videos, etc.) but am new to this part of the game. :D

    Thanks in advance for any helpful hints!
    Steve
     
  8. Steve,

    Being new to WCF Ria myself I found the hardest part was debugging. Also, the fact that the svc files are dynamically generated threw me off track for a bit, but it's great now that I'm used to it. No more adding service references on the client side. Also, the pre-wired authentication service is very nice.

    The key for me was finding that web site where you downloaded the binary. There are bits and pieces posted all over the web about the problems deploying the beta release. The solution provided by Rajneesh is comprehensive and works perfectly, not to mention the silverlight fault fix that he coded him. This allows for error reporting on the client side.

    You should be able to just change the connection string and the baseprefix section, and it should fire right up. I've been playing around with the domain services (Tim Heuers video post on silverlight.net was a huge help for me - it's an hour long but packed with good stuff).

    That's really all I needed to get up and running. Good luck getting started. Post if you come across any issues, maybe I will be able to help.

    -Rob
     

Share This Page