Problems Installing Customer Portal:

Answered Problems Installing Customer Portal:

  • Friday, March 25, 2011 8:17 AM
     
      Has Code

    Am installing the Customer Portal on our own server and linking with Online installation of CRM 2011.

    Small Busiuness Server 2008, IIS7

    and getting the following error when attempting to run site from within IIS7

    Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=d25d1a4517cc3fd4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    [FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=d25d1a4517cc3fd4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
      System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
      System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +314
      System.Type.GetType(String typeName) +84
      Microsoft.Xrm.Client.TypeExtensions.GetType(String typeName) +21
      Microsoft.Xrm.Client.Configuration.InitializableConfigurationElement`1.GetDependencyType() +57
      Microsoft.Xrm.Client.Configuration.CrmConfigurationManager.CreateContext(String contextName, Boolean allowDefaultFallback) +231
      Microsoft.Xrm.Portal.Configuration.<>c__DisplayClass2.<CreatePortalContext>b__1() +93
      Microsoft.Xrm.Client.Configuration.InitializableConfigurationElement`1.CreateDependency(Type type, Func`1 createDefault, Object[] args) +59
      Microsoft.Xrm.Client.Configuration.InitializableConfigurationElement`1.CreateDependency(Func`1 createDefault, Object[] args) +81
      Microsoft.Xrm.Client.Configuration.InitializableConfigurationElement`1.CreateDependencyAndInitialize(Func`1 createDefault, Object[] args) +73
      Microsoft.Xrm.Portal.Threading.HttpSingleton`1.GetInstance(String name, Func`1 create) +137
      Microsoft.Xrm.Portal.Web.Routing.PortalRouteHandler.GetHttpHandler(RequestContext requestContext) +53
      System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +235
      System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +182
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266
    

    ian

All Replies

  • Saturday, March 26, 2011 1:24 AM
    Moderator
     
     Proposed

    I have seen this error myself, but did not get to the root cause.  The fix is to open the solution file for the portal and build the site.


    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Proposed As Answer by Jim Glass Jr Monday, March 28, 2011 7:50 PM
    •  
  • Thursday, March 31, 2011 11:54 AM
     
      Has Code

    Sorry have been on-site with a Customer.

    Thanks for your response.

    I have VS2010 installed on my client machine, but not installed on the server where the Customer Portal is.

    So I've re-build the solution on client machine and copied the updated files back over to the server.

    I have configured via live.azure.com and the domain has been verified. The Customer Portal is running on port 86, is an issue?

    this is the error that is being displayed now, when running the application from within IIS.Description: 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.

    Exception Details: System.ServiceModel.FaultException: Authentication Failure

    Source Error:

    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.

    Stack Trace:

    [FaultException: Authentication Failure]
    
    [MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.]
      System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4767763
      System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
      Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message) +0
      Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr) +69
      Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateLiveIdInternal(ClientCredentials clientCredentials, SecurityTokenResponse deviceToken, String keyType) +869
      Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredentials clientCredentials, SecurityTokenResponse deviceTokenResponse, String keyType) +84
      Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(ClientCredentials clientCredentials, SecurityTokenResponse deviceTokenResponse) +69
      Microsoft.Xrm.Client.Services.OrganizationService.CreateUserTokenResponse(CrmConnection connection, IServiceConfiguration`1 config) +429
      Microsoft.Xrm.Client.Services.OrganizationService.GetUserTokenResponse(CrmConnection connection, IServiceConfiguration`1 config) +288
      Microsoft.Xrm.Client.Services.OrganizationService.ToOrganizationServiceProxy(CrmConnection connection) +248
      Microsoft.Xrm.Client.Services.OrganizationService.ToOrganizationService(CrmConnection connection) +15
      System.Lazy`1.CreateValue() +12769951
      System.Lazy`1.LazyInitValue() +355
      Microsoft.Xrm.Client.Services.InnerOrganizationService.UsingService(Func`2 action) +491
      Microsoft.Xrm.Client.Services.CachedOrganizationService.InnerExecute(OrganizationRequest request) +107
      Microsoft.Xrm.Client.Services.OrganizationServiceCache.InnerExecute(TRequest query, Func`2 execute, Func`2 selector) +16
      Microsoft.Xrm.Client.Services.<>c__DisplayClass6`3.<LookupAndInsert>b__4(ObjectCache cache) +194
      Microsoft.Xrm.Client.Caching.<>c__DisplayClass9`1.<Get>b__8(String key) +24
      Microsoft.Xrm.Client.Threading.<>c__DisplayClass5`1.<Get>b__3(Mutex _) +43
      Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action) +483
      Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService) +236
      Microsoft.Xrm.Client.Threading.MutexExtensions.Get(String key, Func`2 loadFromCache, Func`2 loadFromService) +81
      Microsoft.Xrm.Client.Services.OrganizationServiceCache.LookupAndInsert(TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey) +414
      Microsoft.Xrm.Client.Services.OrganizationServiceCache.InnerExecute(TRequest request, Func`2 execute, Func`2 selector, String selectorCacheKey) +173
      Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(OrganizationRequest request, Func`2 selector, String selectorCacheKey) +225
      Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(OrganizationRequest request) +177
      Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request) +254
      Microsoft.Xrm.Sdk.Linq.QueryProvider.RetrieveEntityCollection(OrganizationRequest request, NavigationSource source) +213
      Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords) +343
      Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups) +131
      Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(Expression expression) +216
      Microsoft.Xrm.Sdk.Linq.QueryProvider.GetEnumerator(Expression expression) +66
      System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +220
      Microsoft.Xrm.Portal.Cms.WebsiteSelectors.NameWebsiteSelector.GetWebsite(OrganizationServiceContext context, RequestContext request) +45
      System.Lazy`1.CreateValue() +12769951
      System.Lazy`1.LazyInitValue() +355
      Microsoft.Xrm.Portal.PortalContext.get_Website() +76
      Microsoft.Xrm.Portal.Web.CrmSiteMapProvider.FindSiteMapNode(String rawUrl) +313
      Microsoft.Xrm.Portal.PortalContext.GetNode(RequestContext request) +217
      System.Lazy`1.CreateValue() +12769951
      System.Lazy`1.LazyInitValue() +355
      Microsoft.Xrm.Portal.PortalContext.get_Entity() +65
      Microsoft.Xrm.Portal.Web.Routing.PortalRouteHandler.GetHttpHandler(RequestContext requestContext) +108
      System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +11335704
      System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
      System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    Server Error in '/' Application.

    Authentication Failure

     


    ian
  • Thursday, March 31, 2011 12:54 PM
     
      Has Code

    Also confirming that i've understood the following settings

    <add name="Live" connectionString="Application Id=<Client ID from live.azure.com>; Secret=<Secret Key from live.azure.com>"/>
  • Thursday, March 31, 2011 1:59 PM
    Moderator
     
     Answered
    The error above appears to be with your CRM connection string, not your Live Id connection string.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Proposed As Answer by Jim Glass Jr Monday, April 04, 2011 7:17 PM
    • Marked As Answer by Jim Glass Jr Tuesday, May 24, 2011 6:33 PM
    •  
  • Wednesday, April 20, 2011 4:31 PM
     
     

    Hello,

    I install Microsoft CRM 2011 on Premises edition, install portal, verify domain for Live ID. But portal not working properly. Error:

    Could not load file or assembly 'Microsoft.Xrm.Client, Version=5.0.1.0, Culture=neutral, PublicKeyToken=d25d1a4517cc3fd4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    How need to "open the solution file for the portal and build the site"?

  • Friday, September 23, 2011 6:34 AM
     
     
    The fix is to open the solution file for the portal and build the site.
    Can you comment on this  bit more, please ?
  • Friday, November 18, 2011 11:41 AM
     
     
    hi i am also facing same issue, I have open the solution in VS 2010 and builded but still i am getting same error ? is there anyother solution to get rid of this issue.
  • Friday, November 18, 2011 1:01 PM
    Moderator
     
     
    which error are you getting (there are two different errors in this discussion)?
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
  • Saturday, November 26, 2011 8:29 AM
     
     Proposed

    Its because you are not only wrongly generated xrm.cs.

    But also maybe missing references in XRM project- just add them manualy and rebuild...

    Go to XRM - references and add the 3 that are corrupted : Microsoft.xrm.client, Microsoft.xrm.portal and Microsoft.xrm.sdk

    for online the right command is:

     

    CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"/url:https://XXX.api.crm4.dynamics.com/XRMServices/2011/Organization.svc /out:xrm.cs /username:"name" /password:"pass /namespace:Xrm  /serviceContextName:XrmServiceContext  /serviceContextPrefix:Xrm

    • Proposed As Answer by CReativeMages Saturday, November 26, 2011 8:29 AM
    •