[CRM 2016] Error code #0x80040237. Error while solution import. Cannot insert duplicate key.

We were deploying from sandbox to production with one of the solutions. And for no reason, the solution import failed on all attempts with error code #0x80040237. And there was not much description given except – “Cannot insert duplicate key”. This was the error on one of the entities.

First, we followed a post by a friend on the same error. We even removed some data to check if that is the case. But, the import failed again with the same error code and description.

Then, we came across similar question on MSDN. Question was already showing an answer that by removing <CustomControlDefaultConfigs> section from Solution.xml this can be resolved. This issue is already taken care on Dynamics 365. However, CRM 2016 Online, this issue still persists.

Resolution:

  • Extract your solution zip file.
  • Open solution.xml file in a text editor.
  • Search for the <entity></entity> tag for the entity on which your solution import is showing the error.
  • Find and remove <CustomControlDefaultConfigs> section inside the <entity> section.
  • Save the solution.xml file and create new zip file from the extracted solution contents.
  • Import will be successful this time!!

The reason to remove <CustomControlDefaultConfigs> section from solution.xml file is still not known. And there are other option also available like updating sql to resolve this error for on premise deployments. However, CRM Online users do not have any option but to modify solution.xml file.

Hope this helps!

Advertisements

Access to Microsoft Dynamics CRM has not yet been fully configured for this user. The user needs at least one security role before you can continue.

I ran into an issue when I was importing a different version  of solution to the organization. The error was:

Access to Microsoft Dynamics CRM has not yet been fully configured for this user. The user needs at least one security role before you can continue.

I was not able to find anything on google/bing for the specific error, but one of the blog I found said the error can be from business rules or other type of processes.

After some research, I came to know that there were multiple Business Rules on the organization which were owned by users who were deactivated and no longer have anything to do with CRM Development.

Resolution:
To resolve this issue, you just  need to assign the Business Processes or other workflows to any active user.

Step 1: Use Advanced Find feature to find the processes and their respective owners.

Advanced Find - Business Rules
Advance Find Business Rules

 

Step 2: Select all results which shows owner who are already disabled.

Advanced Find Result

Advanced Find – Result

Step 3: Assign the Business Rules/Processes to your user account or another user who is in active state.

Assign

Assign processes

And you’re done!! Try to reimport the solution and the error will be gone forever…

CRM 2011, C# Error: The given key was not found in the dictionary.

Many a times unexpected things happen while programming. And in case of Dynamics CRM it “does” happen. Similar issue happened with me today. The subject of the blog post was the annoying error I wanted to get rid off.

The given key was not found in the dictionary.

The first thing comes into the programmers’ mind is that there is nothing in this error and they just need to cross check with the attribute logical names they have used in coding.

To solve this I cross checked each and every attributes from Dynamics CRM and my C# code and not for single but 3-4 times. Finally, I got the idea that all my code is working absolutely correct with nothing wrong in it.

The real issue was not my code but a plugin/workflow activity developed by some other programmer which was registered on the same entity which I was working on. I disabled the step of the workflow activity and the program worked like a charm.

Check for the Plugins or Workflow Activities registered on the same entity to drill down with your issue.

Happy programming!!

CRM 2011 Web Page Error: The server was unable to process the request due to an internal error either from ServiceBehaviorAttribute or from the configuration behavior

I was working with a web application which connects to the CRM 2011 Organization Web Service. While developing it through Visual Studio the application was working like a charm! And as soon as I published it to the IIS 7, it began showing me following error and stack trace.

The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

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: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

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: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4767763
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request) +0
Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request) +892
xxxxxxxTool.xxxxxContacts.Page_Load(Object sender, EventArgs e) in C:\Users\Administrator\Desktop\xxxxxxxTool\xxxxxxxTool\xxxxxContacts.aspx.cs:173
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048

Looking at the error details, I was not sure what was wrong with a piece of code I wrote! I didn’t even used .Net Framework 3.0 SDK?!? With some findings on net I found some attributes for ServiceBehaviors that should be added to web.config shown as below.

<behaviors>
  <serviceBehaviors>
    <behavior name="SecurityTokenServiceBehavior">
      <!--The serviceMetadata behavior allows one to enable metadata (endpoints, bindings, services) publishing.
This configuration enables publishing of such data over HTTP GET.
This does not include metadata about the STS itself such as Claim Types, Keys and other elements to establish a trust.-->
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
      <!--Default WCF throttling limits are too low-->
      <serviceThrottling maxConcurrentCalls="65536" maxConcurrentSessions="65536" maxConcurrentInstances="65536" />
    </behavior>
  </serviceBehaviors>
</behaviors>

This was not sufficient as error was still there! I thought I had a problem with my IIS, I reinstalled it! Still there is same error. I checked to the other PCs but the issue persisted. Finally I got the solution by some R&D on IIS part.

Through MSDN I found that the Applications made for CRM or using any web services of CRM 2011 will need the same configuration as CRM App Pool. If the application will not consume more, you can use the same App Pool that CRM 2011 web application uses.

The Similar AppPool created for the application must be running on Classic mode and Identity should be Network Service.

And some authentication settings to the web application developed for the CRM will help the application run without issues on IIS 7. Follow this image for Authentication to web application to set.

Authentication Settings

Authentication Settings

Anonymous Authentication should be Disabled. CRM needs Windows Authentication, Enable it. And there is no need to have a Forms Authentication, Disable it.

After all these settings your application should work as expected.

Happy Troubleshooting!!

CRM 2011 Workflow Error: The system could not log you on. This could be because your user record or the business unit you belong to has been disabled in Microsoft Dynamics CRM

Sometimes it happens when your workflow goes for infinite Wait state. And you experiencing this error-

Access Error:
The system could not log you on. This could be because your user record or the business unit you belong to has been disabled in Microsoft Dynamics CRM.

Workflow Error

Workflow Error

This actually can happen for a variety of reasons. But, you might want to see the following things to resolve:

  • See the owning User and the Business Unit. If they are disabled or not. Enable them if disabled.
  • Check SQL database ORG_MSCRM -> SystemUserBase table to see IsDisabled column value for the User.
  • If the workflow is developed with a User and then assigned to someone else. If this is the situation, reassign to original user.

 

Outlook/Exchange Error: #5.1.1 smtp;550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found

When you receive errors like < #5.1.1 smtp;550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found>, when you are sending emails and those email bounce back creating Non Delivery Recipients. You don’t know what to do and what is exactly going on with the error? I faced the same error for the first time.

Looking at the error codes given here (http://www.emailaddressmanager.com/tips/codes.html) it seemed “Bad Destination Mailbox”. But when I saw others were sending mails to that mailbox without any trouble. I searched for many forums but not succeeded. Finally, I got it resolved.

What causes this?
When you have shared your calendar to another contact, this usually creates issues and you may face similar kind of error messages.

Resolution:
Simply, unshare your calendar. And if you really want your invites to be shared with some other contacts? Make a rule that will forward your meeting requests to other contacts. This will resolve issues.

Solved: Sys.WebForms.PageRequestManagerTimeoutException – The server request timed out error

If you have got this error: “Sys.WebForms.PageRequestManagerTimeoutException The server request timed out” from the Ajax Extension framework. It is because you have not mentioned the timeout period for the script manager on your page. The default timeout period of script manager is 90 seconds, so if your process takes more than 90 seconds you will be presented this error.

Solution:

Add a property AsyncPostBackTimeOut to your script manager as following:

<asp:ScriptManager ID=”ScriptManagerAjax” runat=”server” AsyncPostBackTimeout=”720″>
</asp:ScriptManager>

The timeout period is in seconds that is 12 minutes. You can specify it according to your need.

Hope this helps! Happy Programming!

Stunnware tools for CRM 2011 not working? The Plug-In FetchXML Wizard threw an exception: Could not load file or assembly 'Microsoft.Crm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Downloaded the Stunnware tools for CRM 2011 and experiencing error below?

The Plug-In FetchXML Wizard threw an exception: Could not load file or assembly ‘Microsoft.Crm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Stunnware Tools - CRM 2011 error screen

CRM 2011 supports backward compatibility by exposing support for the old SDK, it supplies its own version of Microsoft.Crm.Sdk.dll. The difference is that it is strongly signed with an updated version number of 5.0.0.0.

We can force the runtime to load our own supplied version of Microsoft.Crm.Sdk by overriding the publisher policy. This is done in App.config or Web.config for a web application (here SwTools.exe.config) using the following code:

<?xmlversion="1.0"encoding="UTF-8"?>
<configuration>
    ...
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Crm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <publisherPolicy apply="no" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Go to edit your SwTools.exe.config file and add <runtime>…</runtime> section from above code to the end of the config file before </configuration> tag. and Done!!

CRM 2011 Error: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Are you using an application/tool that communicates with CRM 2011 and facing the error?

CRM 2011 Error: Could not load file or assembly ‘Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

Then probably you would want to install Windows Identity Foundation. The Windows Identity Foundation helps simplify user access for developers by externalizing user access from applications via claims and reducing development effort with pre-built security logic and integrated .NET tools. Download it from here and install.

Happy to help!

CRM 2011 Error: No plugins have been selected from the list. Please select at least one and try again.

Getting the message “No plugins have been selected from the list. Please select at least one and try again.” while publishing the Custom Workflow Activity with Plugin Registration Tool?

When you are uploading your dll into the Registration Tool, the tool looks for any Plugin or Custom Workflow Action classes that are defined by your dll. In this case the tool is not finding any valid Classes in your dll, and so the ‘Select Plugin..’ list presented does not contain any valid Plugins to register.

Solution:

Look the class definition where you have overridden the execute() method. The class must be inherited by CodeActivity Class. Declare the class as a Public class. And re-compile the dll and upload it to plugin registration tool and load.

You are done!