Strange one here. Just importing a managed solution from Dev > UAT for testing purposes. I'm getting a single missing depency error when trying to import whereby the missing table is required by... itself?! The table is, of course, in the managed solution.
Never seen this happen before?! Any help appreciated...
@AnttiKai your answer is the only thing that worked for me. Kinda lame that it wanted to include circular references in the package so badly. This really feels like a bug to me.
Anyway, I ended up scripting this in PowerShell to remove circular references from our solutions (via our ADO Build Pipeline; this should be run this after the solution is exported and extracted with PAC):
# Find all "Solution.xml" files, recursively
$solutions = gci -recu -inc "Solution.xml"
# For each file found:
foreach($solution in $solutions)
{
$xml = [System.Xml.XmlDocument](cat $solution);
$mdeps = $xml.SelectNodes("/ImportExportXml/SolutionManifest/MissingDependencies/MissingDependency");
$changes = $false;
foreach($mdep in $mdeps)
{
# Grab the Required and Dependent tags:
$req = $mdep.SelectSingleNode("Required");
$dep = $mdep.SelectSingleNode("Dependent");
# skip any dependencies that don't have type and schemaName defined for both.
if (-not (($req.Attributes | % { $_.Name }) -icontains "type")) { continue; }
if (-not (($dep.Attributes | % { $_.Name }) -icontains "type")) { continue; }
if (-not (($req.Attributes | % { $_.Name }) -icontains "schemaName")) { continue; }
if (-not (($dep.Attributes | % { $_.Name }) -icontains "schemaName")) { continue; }
# Do the types match for both the required and the dependent tag?
if ($req.Attributes["type"].Value.ToString() -eq $dep.Attributes["type"].Value.ToString())
{
# Do the names match for both the required and the dependent tag?
if ($req.Attributes["schemaName"].Value.ToString() -eq $dep.Attributes["schemaName"].Value.ToString())
{
# Are the tags otherwise identical (aside from their tag name and the solution attribute)?
if (($req.Attributes | % { $_.Name }) -icontains "solution")
{
if ($req.Attributes["solution"].Value.ToString() -ieq "Active")
{ [void]$req.RemoveAttribute("solution"); }
}
if (($dep.Attributes | % { $_.Name }) -icontains "solution")
{
if ($dep.Attributes["solution"].Value.ToString() -ieq "Active")
{ [void]$dep.RemoveAttribute("solution"); }
}
if ($req.OuterXml.Replace("<Required ", "<A ") -ieq $dep.OuterXml.Replace("<Dependent ", "<A "))
{
# Remove Circular Reference Dependency
[void]$mdep.ParentNode.RemoveChild($mdep)
$changes = $true;
}
}
}
}
if ($changes)
{
$xml.Save($solution);
Write-Host "Updated $solution."
}
}
And giving anoter reply if someone comes here looking for the answer. For me the problem was (for now) solved by:
1. Creating a new solution with all the same, needed components, making sure to "include table metadata" and NOT "Include all objects"
2. After export, editing the solution.xml file found within the exported Zip folder to comment out those missing dependencies that give error when starting the import. This was done for a few circular references because who knows why some tables might want to require themselves.
Hey @WayneIles thanks for the info! Unluckily this does not solve my issue. I'm trying to import into a blank environment and these two tables have become tangled within themselves in some weird way...
Have a good day!
Hey @AnttiKai
Was a while ago now but this was related to active business rules on the table in the target environment that had been deleted from the managed solution that I was trying to import from the source environment.
Annoyingly the dependency pop up doesn’t mention business rules at all, hence my initial confusion.
As it was a managed solution I couldn’t delete the business rule from the target environment - memory is hazy but I’m pretty sure I simply deactivated the business rule in target, then importing the managed solution (with deleted business rule) worked fine.
Hey @WayneIles I'd be really happy to hear if you solved the issue or if you can point me towards material that is helpful in this situation. I'm facing the exact same problem currently..
regards, have a nice day all!
/Antti
Hello @WayneIles
That was strange, can you please try this last attempt which am having in my mind
Download XRMToolbox tool
And install component "DependencyIdentifier"
https://github.com/Power-Maverick/DependencyIdentifier
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Have of course done 1 & 3 multiple times with same results.
RE: #2 - I really don’t want to bloat this solution and include ALL components from the ‘Master Project’ table. Largely because this is a really simple lightweight model driven app – solution contains just 4 tables, 2 choices, a site map and a MDA.
Beneath the Master Projects table there is a large hierarchy of 1:N relationships that are completely unrelated to this solution (and will be moved to UAT in separate solution(s) in due course). I’d have to add dozens of other tables, choices etc to this solution just to workaround this problem - which in itself makes absolutely no sense at all!!!
It’s worth noting that there are zero other dependency issues mentioned in the error log, which leads me to believe there’s no issues with components I’ve excluded from the Master Project table within the solution.
Hello @WayneIles,
Hope you are doing good, this issue may happen because of below scinario's
1. Make Sure you PUBLISH your solution before Exporting in DEV environment
2. In the Dev Environment --> Click on the Table and Select ADD REQUIRED COMPONENTS --> PUBLISH and Import it
3. Try Removing the Entity and ADD IT AGAIN --> PUBLISH and Import it
Any one of the three can help you
Please mark as Answer if it is helpful and provide Kudos
Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com
stampcoin
15
ankit_singhal
11
Super User 2025 Season 1
mmbr1606
9
Super User 2025 Season 1