Functional Info

SOLUTION – FIND MISSING DEPENDENCIES WHEN DELETING A SOLUTION

When deleting a solution in Dynamics CRM, the system checks for dependencies first. If any of the dependencies still exist, then the delete operation will be aborted and the user will receive an error message:  

Cannot Delete Component (Cannot delete Main because one or more components require it.” 

The only option for more info, is the Download Log File, but this doesn’t tell you really what happened either: 

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.Detail:  

<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”&gt; 

…… 

<d2p1:key>4</d2p1:key> 

<d2p1:value xmlns:d4p1=”http://www.w3.org/2001/XMLSchema” i:type=”d4p1:string”><a id=’a_helplink’ tabindex=’0′ class=’ms-crm-Dialog-Error-Link’ onclick=’openStdWin(“\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall”, null, 800, 600, null)’>Details</a></d2p1:value> 

</KeyValuePairOfstringanyType> 

</ErrorDetails> 

<Message>The Main() component cannot be deleted because it is referenced by 1 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.</Message> 

  • However, there seems to be a little bit of useful info in there. This is the section

 “\x2ftools\x2fdependency\x2fdependencyviewdialog.aspx\x3fobjectid\x3d\x257b703af1df-aafb-4c61-b97f-da639fbe8d27\x257d\x26objecttype\x3d7100\x26operationtype\x3ddependenciesforuninstall”   

  • When replacing some characters (“\x2f” to “/”, “\x3” to “?”, “\x3d” to “=”, “\x26” to “&”, “\x257b” to “{” and “\x257d” to “}”), then you’re presented with the URL: /tools/dependency/dependencyviewdialog.aspx?objectid={703af1df-aafb-4c61-b97f-da639fbe8d27}&objecttype=7100&operationtype=dependenciesforuninstall. 
  • Add “http://%5Byourserver%5D to the beginning and you’ve got your url that’ll tell you exactly what dependencies to remove before you can remove the (managed) solution.
  • A shorter approach, but just as effective would be to take this URL and change your server and the solution GUID:

httXp://yourserver/tools/dependency/dependencyviewdialog.aspx?objectid={solutionguid}&objecttype=7100&operationtype=dependenciesforuninstall  

  • Your solution GUID can be found by opening the solution and pressing F11 or CTRL+N to see the URL. In the URL take the section between %7b and %7d:

https://%5Byourserver%5D/tools/solution/edit.aspx?id=%7bC418E1D5-9AFB-E311-90E1-00155D042F50%7d) and you’re set to go! 

Power Platform my friend!

Advertisement

One thought on “SOLUTION – FIND MISSING DEPENDENCIES WHEN DELETING A SOLUTION

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s