Archive
Power Apps component framework | Import Solution Failed: Object reference not set to an instance of an object
While importing our PCF Code Component, using pac pcf push command, we got an error Import Solution Failed: Object reference not set to an instance of an object.
Reason and Fix:
- Error was bit difficult to troubleshoot as there was no detailed error message. Turns out the issue was due to the usage of ‘Custom Events’ which is still unsupported at the time of writing this article.
- As per official docs, support for the custom events will be planned for future which can be used for communicating changes outside of a control without adding a column configuration.
- Fix is obvious that we had to remove custom events and import the solution.
đ
Solution Import Failures / Publish Customizations Failures – Dynamics 365
Recently we upgraded our organizations to Dynamics 365 and we were getting solution import failure while moving solutions between organizations.
Below are different kind of error messages popped up.
- Getting Dependency Calculation There was an error calculating dependencies for this component. Missing component id {0}
- Failure trying to associate it with CustomControlDefaultConfig
- Can’t insert duplicate key for an entity
Reason:
- In our case the root cause for all these import failures was âcustomcontroldefaultconfig” component with Custom entities.
- If there is any orphan record exists in âCustomControlDefaultConfigBaseâ table it would cause solution import failure or âPublish Customizationsâ error.
- The issue seems a product issue and got fixed in Service Update 5 of CRM 8.1.0 but resurfacing again in Dynamics 365.
Prevention Tip:
- If you are adding an entity to your solution, always add âPrimary keyâ field
- In the source environment open the Solution being imported
- Open each Entity and expand Fields
- Make sure that every entity has its “Primary Key” added to the solution.
Fix:
CRM On-Premise
- Check if any orphan records in CustomControlDefaultConfigBase tabel. (Use below queries)
- SELECT * FROM CustomControlDefaultConfigBase WHERE PrimaryEntityTypeCode NOT IN (SELECT ObjectTypeCode FROM Entity)
- Note: before continuing, a backup database is recommended.
- Delete from the Target environment the CustomControlDefaultConfig records with orphaned Object Type Codes:
- DELETE FROM CustomControlDefaultConfigBase WHERE PrimaryEntityTypeCode NOT IN (SELECT ObjectTypeCode FROM Entity)
CRM On-line
- Create console application to delete the orphan record in CustomControlDefaultConfigBase using CRM SDK
- Refer this URL for code.
đ
Found dependency records â Error while solution import in CRM 2011
I was getting the error when I was importing Managed Solution on top of Unmanaged solution
Found 2 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = {}, type = AttributeMap, requiredcomponentobjectid = {}, type= EntityMap, solution = {})”
Interestingly, I did not get error when I imported Unmanaged solution
Reason
- From the error message I understand error was with âAttribute Mapsâ
- This error occur, If there is a custom mapping from an entity outside a managed solution to an entity inside a managed solution, which is not allowed
Fix
- We have to delete existing AttributeMap from the customation.xml file as well as the CRM system
- Follow resolution steps mentioned in Dynamics CRM Team Blog
đ
Fields that are not valid were specified for the entity – Solution Import Error in CRM 2011
Hi,
In one of my CRM 2011 deployments when I tried to import my solution from Development to Test environment I got below error
Fields that are not valid were specified for the entity
After examining the customization changes made we came to know the actual problem.
Reason –
- We had an attribute ânew_abcâ that was of type âTwo Optionsâ
- Later  we got a change request from client, that the field has to be an option set.
- So in Development environment, we deleted the field  ânew_abcâ of type âTwo optionsâ and created a new field again with same name ânew_abcâ of type âOption setâ.
- When we tried to import back the new solution to test environment we got this Import failure message.
Fix :-
- We fixed this by deleting the field in the import environment (i.e., Test environment in my case)Â prior to the import of new solution.
- To avoid this problem provide different name to the newly created field
Hope it helps đ
Solution with Plug-Ins import error in CRM 2011
Hi,
You may get below error, when you try to import solution with Plug-in’s (or) registering a Plug-In using Plug-In registration tool
Action failed for assembly ‘assemblyname,Version=1.0.0.0, Culture=neutral, PublicKeyToken=c79c3c28c5ba3ec0′: Assembly must be registered in isolation.
Reason :-
- The User  who is trying to register is not a  “deployment administrator”
Fix :-
- Add User as “deployment administrator” by following below steps
- Open “Deployment Manager” tool
- Under “administrator’s” tab, Right click and add current user
- Reset IIS
Hope it Helps đ