I have been following a post on how to set up a basic portal, but I keep running into problems. This is a learning curve for me, more or a practice run as a learning tool. I am simply trying to connect to CRM to the Accounts entity but keep getting. Please bear in mind that at the moment I am just looking to connect to Account entity without errors, before I investigate displaying data, hence my form has no fields. The project loads fine, but I get the error when calling the Administration.aspx page.
Server Error in '/' Application.
The value 'Xrm.XrmServiceContext, CBICustomerPortal' is not recognized as a valid type or is not of the type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceContext'.
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.Configuration.ConfigurationErrorsException: The value 'Xrm.XrmServiceContext, CBICustomerPortal' is not recognized as a valid type or is not of the type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceContext'.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: |
Stack Trace:
[ConfigurationErrorsException: The value 'Xrm.XrmServiceContext, CBICustomerPortal' is not recognized as a valid type or is not of the type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceContext'.] Microsoft.Xrm.Client.Configuration.InitializableConfigurationElement`1.GetDependencyType() +248 Microsoft.Xrm.Client.Configuration.OrganizationServiceContextElement.CreateOrganizationServiceContext(IOrganizationService service) +95 Microsoft.Xrm.Client.Configuration.CrmConfigurationProvider.CreateContext(String contextName, Boolean allowDefaultFallback) +85 Microsoft.Xrm.Client.Configuration.CrmConfigurationManager.CreateContext(String contextName, Boolean allowDefaultFallback) +55 Microsoft.Xrm.Portal.OrganizationServiceContextFactory.Create(String name) +7 Microsoft.Xrm.Portal.Web.UI.WebControls.CrmDataSourceView..ctor(CrmDataSource owner, String name, HttpContext context) +64 Microsoft.Xrm.Portal.Web.UI.WebControls.CrmDataSource.GetView() +51 Microsoft.Xrm.Portal.Web.UI.WebControls.CrmDataSource.TrackViewState() +20 System.Web.UI.Control.InitRecursive(Control namingContainer) +159 System.Web.UI.Control.InitRecursive(Control namingContainer) +318 System.Web.UI.Control.InitRecursive(Control namingContainer) +318 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6746 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +250 System.Web.UI.Page.ProcessRequest() +76 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +24 System.Web.UI.Page.ProcessRequest(HttpContext context) +62 ASP.administration_aspx.ProcessRequest(HttpContext context) +48 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73 |
<!--
For more information on how to configure your ASP.NET application, please visit
go.microsoft.com/.../
-->
<configuration>
<configSections>
<section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection,Microsoft.Xrm.Client"/>
</configSections>
<add name="WebFormDataSource" connectionString="Url=https://xxx.xxxxx.xx.xx:444; Username=administrator@xxxxxx; Password=xxxxxxxx"/>
</connectionStrings>
<microsoft.xrm.client>
<contexts>
<add name="WebFormDataSource" type="Xrm.XrmServiceContext, CBICustomerPortal" />
</contexts>
</microsoft.xrm.client>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
<pages>
<namespaces>
<add namespace="System.Web.Optimization"/>
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
<add tagPrefix="crm" namespace="Microsoft.Xrm.Portal.Web.UI.WebControls" assembly="Microsoft.Xrm.Portal" />
</pages>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
</configuration>
<head runat="server">
<title>Administration</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<crm:CrmDataSource ID="WebFormDataSource" runat="server" />
<crm:CrmEntityFormView runat="server" DataSourceID="WebFormDataSource" ID="Administration" EntityName="Account" SavedQueryName="Active Accounts" ValidationGroup="validators" ></crm:CrmEntityFormView>
</div>
</form>
</body>
</html>
Imports Microsoft.Xrm.Client.Services
Imports Microsoft.Xrm.Portal.Web.UI.WebControls
Inherits System.Web.UI.Page