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.
- 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!
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.
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.
- Advance Find Business Rules
Step 2: Select all results which shows owner who are already disabled.
Advanced Find – Result
Step 3: Assign the Business Rules/Processes to your user account or another user who is in active state.
And you’re done!! Try to reimport the solution and the error will be gone forever…
At some point of time the script goes to reload the html Web Resource with the following code:
var webResource = Xrm.Page.getControl("WebResource_ControlName");
Easiest way to reload the web resource!
But the same code does not work in case of CRM 2016. As the web resource was already loaded when the page was loaded. CRM 2016 treats the same web resource not to be loaded again (may be for better performance!).
After trying numerous ways to solve, following code worked perfectly:
var webResource = Xrm.Page.getControl("WebResource_ControlName");
webResource.setSrc(Xrm.Page.context.getClientUrl() + "/WebResources/new_webResource?data=someValue%26ver%3D" + Math.random());
Here, I had to pass some parameters. What I have done to modify is added another parameter called “ver” (you can have any other parameter name instead of “ver”) and the value will be rendered from Math.random() method. This way the web browser treats each URL as a new request as Math.random() will return random number each time it will be executed.
As described in the subject line, when user hits the Save/Save & Close button, nothing happens. Quote records are not saved, not even a post back happens when hitting save. We checked all different scenarios and nothing worked as Save event was not triggered.
Users/Team were assigned OOB “Sales Person” roles.
Give Product entity a full access to the security role and check saving again. It should work.
If you are a seasoned CRM/XRM developer, you must have heard about XrmToolbox. If you have, you can simply ignore this post. BUT if you have not then you MUST read on.
This post is about XrmToolbox (http://www.xrmtoolbox.com/) and its plugins which can improve your efficiency and accelerate overall development speed. I intend to list all the default plugins and provide more details on plugins as and when time permits. So here is a list of plugins which gets installed by default.
Continue reading on: XrmToolBox – A Must have tool for CRM/XRM Developers
The Microsoft CRM Email Router Service will not start every time you start it manually from Services and throws an error message “The Microsoft CRM Email Router service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.”
Event log entries say:
Event Type: Error
Event Source: MSCRMEmail
Event Category: None
Event ID: 0
#16192 – The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down. System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. —> System.Xml.XmlException: Root element is missing.
This means your Email Router configuration file is corrupted.
You need to go to C:\Program Files\Microsoft CRM Email\Service and delete the Microsoft.Crm.Tools.EmailAgent.SystemState.xml file. Try to re/start the Email Router Service. This should resolve your problem.
I was porting a .Net 2.0 assembly to .Net 4.0 plugin assembly and faced this particular challenge.
The project had a test app(A WinForm app) and it worked fine on the desktop but when I deployed the logic on server to run as a plugin it gave the following error
xyz..GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext) Security accessibility of the overriding method must match the security accessibility of the method being overriden.
Just notice, the spelling for “overridden” is also not correct. But this is what .Net framework threw.
After some research I found that this behavior is “By Design” i.e. as per security transparency model defined in .Net v4.0. It basically has two models:
1. Level1 (High Level) for v2.0
2. Level2 for v4.0
Here is a a list of critical operations:
1. Call native code
2. Contain unverifiable code
3. Call critical code
4. Perform security asserts
5. Satisfy link demands
6. Derive from non-transparent types
7. Override security critical virtuals
And only full trust code can be security critical.
Hence an overridden member should have the same security accessibility (Critical, Safe Critical or Transparent).
To resolve this error take the following step:
Go to the AssemblyInfo.cs class to your project and add following attributes to it. And this should resolve the exception.
I believe it might be helpful to many as there are lot of Dynamics CRM implementations being upgraded.
Reference links to the differences between both and transparency rules: