I am deploying my solution to another environment and I am not getting any depedency issues. the solution starts importing but then it shows :failed to import " because of following error:
Import of app module(s) failed: Value cannot be null. Parameter name: canvasAppReference
I have no idea why this is happening, because i have selected option "include all objects" for the model-driven app in the solution and also for the canvas app in solution.
if anybody has ideas please let me know
I have finally resoled the issue by unpacking the solution zip file and editing manually AppModule.xml file and then repacking, importing back to the solution. The cause looks like a bug in the Microsoft's Power Apps solution management.
Use the following pac command:
# Unpack
pac solution unpack --zipfile yoursolution_1.1.2.59.zip --folder Unpacked\unpacked_1.1.2.59\.
# Repack after edit
pac solution pack --folder Unpacked\unpacked_1.1.2.59\ --zipfile yoursolution_1.1.2.59_repacked.zip
Once unpacked, load the files in Visual Studio (or your favorite editor) and examine AppModule.xml files under AppModule folder. I discovered one of AppElement has missing <canvasAppId> :
<appelement uniquename="..._manageedits_4f5eb">
<canvasappid>
<name>..._manageedits_4f5eb</name>
</canvasappid>
<iscustomizable>1</iscustomizable>
<name>..._manageedits_4f5eb</name>
</appelement>
<appelement uniquename="..._editinitiative_a8ddb">
<iscustomizable>1</iscustomizable>
<name>..._editinitiative_a8ddb</name>
</appelement>
I showed one normal appelement ("..._manageedit") and a broken one ("...editinitiative") above. You can see the second element has missing "<canvasappid><name>..._editinitiative_a8ddb</name></canvasappid>" part. This aligns well with the deployment error message "Value cannot be null. Parameter name: canvasAppReference" too.
I am not sure how this broken element was creeped into my solution but I guess Power Platform did not completely removed all the reference when I deleted an unnecessary custom page (custom pages are considered as "canvas app" in the unpacked xml files). This must be a bug in the platform.
So, what I did was basically, add back the deleted custom page to my solution, exported again, still the <canvasappid> element was missing, manually add them back, repack, re-import, export again, unpack, confirm my edit of <canvasappid> was still there, then pushed to TEST environment again. Voila! it deployed successfully.
Hope this helps. Cheers!
Here's the stack trace of the error:
System.ArgumentNullException: Value cannot be null. Parameter name: canvasAppReference
at Microsoft.Dynamics.AppModule.Plugins.Common.Exceptions.ThrowIfNull(Object obj, String name, ITelemetryProvider telemetryProvider)
at Microsoft.Dynamics.AppModule.Plugins.CreateAppElement.ExecuteInternal(IServiceProviderWrapper serviceProvider)
at Microsoft.Dynamics.AppModule.Plugins.PluginBase.<>c__DisplayClass0_0.<Execute>b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass6_0.<RunStep>b__0()
It happened after I included a custom control. Solution Checker did not give any serious problems. The deployment pipeline from dev to test validated the solution with "passed" but threw an error:
Same here. Any one?
Same here. No clue what is causing this issue
I would suggest using the Solution Checker to try and identify the missing dependencies. You can see the Microsoft Documentation here https://learn.microsoft.com/en-us/power-apps/maker/data-platform/use-powerapps-checker
---------------------------
If the solution I provided assisted you in resolving this issue, kindly select "Accept as solution".
WarrenBelz
225
Most Valuable Professional
MS.Ragavendar
110
stampcoin
101