I am creating an ASP.NET website that retrieves and inserts data inside CRM 2011. Everything went well, the page was deployed to the server, and it was ready for testing.
Suddenly, a new change appeared, and after I deleted the files on the server and reissued the project (I know it is not needed, but still ...). I could no longer access the website.
All I get is a 500-Internal Server Error There is a problem with the resource you are looking for and cannot be displayed.
I tried to enable the debug function with debug = "True" in the page title, I set
<customErrors mode="Off"/> <compilation debug="true" targetFramework="4.5"/>
In the web.config file, I also tried adding
<httpErrors errorMode="Detailed" />
but none of them helped improve the error message.
My web.config file:
<?xml version="1.0"?> <configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> </configSections> <connectionStrings> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-ASP-20130619150943;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-ASP-20130619150943.mdf"/> </connectionStrings> <system.web> <customErrors mode="Off"/> <compilation debug="true" targetFramework="4.5"/> <httpRuntime/> <pages controlRenderingCompatibilityVersion="4.0"> <namespaces> <add namespace="System.Web.Optimization"/> </namespaces> <controls> <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/> </controls> </pages> <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/"/> </authentication> <profile defaultProvider="DefaultProfileProvider"> <providers> <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> </providers> </profile> <membership defaultProvider="DefaultMembershipProvider"> <providers> <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> </providers> </membership> <roleManager defaultProvider="DefaultRoleProvider"> <providers> <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> </providers> </roleManager> <sessionState mode="InProc" customProvider="DefaultSessionProvider"> <providers> <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/> </providers> </sessionState> </system.web> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246"/> <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246"/> <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/> </entityFramework> <appSettings> <add key="CRMUserName" value="xxxx" /> <add key="CrmUserPassword" value="yyyy" /> <add key="OrganizationUri" value="https://uuuuuu/XRMServices/2011/Organization.svc" /> <add key="HomeRealmUri" value="" /> </appSettings> </configuration>
When the page starts, an error message appears. Error message: System.ServiceModel.FaultException error occurred while checking the security for the message: An error occurred while checking the security for the message.
Section where the error occurs:
RetrieveAttributeRequest retrieveFreightTerm = new RetrieveAttributeRequest { EntityLogicalName = "account", LogicalName = "address1_freighttermscode", RetrieveAsIfPublished = true };
Any ideas?