Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Beginers help needed trying to create a portal

$
0
0

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:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.


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
<?xml version="1.0" encoding="utf-8"?>
<!--
  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>
  <connectionStrings>
    <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>
  <system.web>
    <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" />
      </controls>
    </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=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>
aspx page
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Administration.aspx.vb" Inherits="CBICustomerPortal.Administration" %>
<!DOCTYPE html>
<html xmlns="">www.w3.org/.../xhtml">
<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
Imports Microsoft.Xrm.Client.Services
Imports Microsoft.Xrm.Portal.Web.UI.WebControls
Public Class Administration
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
End Class
If anyone can point out where I am going wrong on what seems to be a simple exercise, I might actually learn something 

Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>