Archive

Posts Tagged ‘solution import error’

Power Apps component framework | Import Solution Failed: Object reference not set to an instance of an object

December 12, 2022 Leave a comment

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.

🙂

Advertisement

Solution Import Failures / Publish Customizations Failures – Dynamics 365

February 12, 2017 3 comments

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.

solution-add-primary-key-field-of-entity

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

November 19, 2012 Leave a comment

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

March 3, 2012 2 comments

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

August 23, 2011 1 comment

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 🙂