This issue has cropped up from time to time when I attempt to stage a solution for upgrade and apply the solution upgrade. It immediately throws an ugly record doesn’t exist error and the details in the stack trace point to the error message in the title of this article. All of the solutions I’ve come across, when searching, had workarounds that involved direct manipulation of the on-prem database.
Today, I was attempting to stage a solution for upgrade in order to deprecate a few fields that I was no longer using and wanted to remove completely from my Development / Stage and UAT environments. Since I was going to need to roll this solution out to customers who are hosted in Dynamics 365 online, I decided to troubleshoot a little more to find a supported solution for this issue rather than knee-jerk reacting with the first solution I found online. Here’s the full error message for reference
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: solution With Id = f74331c7-a7a7-4e6e-8ab8-92e227103188 Does Not ExistDetail:
<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”>
<ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic” />
<Message>solution With Id = f74331c7-a7a7-4e6e-8ab8-92e227103188 Does Not Exist</Message>
<ExceptionSource i:nil=”true” />
<InnerFault i:nil=”true” />
<OriginalException i:nil=”true” />
<TraceText i:nil=”true” />
While I’m still not sure of the root cause for the problem, I did find a supported method for working around the issue and it was pretty straightforward.
- Rolled back my instance to the backup I took just before importing the solution to stage for upgrade (I might have just been able to delete the staged solution instead).
- Imported the solution directly without staging for upgrade. The solution imported fine.
- Incremented the build version in my solution and exported again
- Imported the solution again and staged for upgrade
- Applied the solution upgrade again and voila no more ‘Solution with Id…’ error.
This worked for my particular manifestation of this issue and may not be a solution for all cases, but it’s definitely a good thing to try before you go tampering with the database directly and it’s certainly not a lot of work and gets the job done.