Skip to main content

Notifications

Community site session details

Community site session details

Session Id : BcIYMbvZhrHbS629jDJMqd
Power Apps - Building Power Apps
Unanswered

Solution Deployment to another environment

Like (0) ShareShare
ReportReport
Posted on 8 May 2024 15:59:20 by 9

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

Categories:
  • Youcef Doumandji Profile Picture
    6 on 25 Nov 2024 at 09:16:25
    Solution Deployment to another environment
    Hi,
    I have exactly the same issue. Did you find a solution ?
    Bets regards.
    Youcef
  • K43876 Profile Picture
    37 on 28 Jun 2024 at 23:16:57
    Re: Solution Deployment to another environment

    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!

     

     

  • K43876 Profile Picture
    37 on 26 Jun 2024 at 18:46:11
    Re: Solution Deployment to another environment

    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.&lt;&gt;c__DisplayClass0_0.&lt;Execute&gt;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.&lt;&gt;c__DisplayClass6_0.&lt;RunStep&gt;b__0() 

  • K43876 Profile Picture
    37 on 21 Jun 2024 at 19:59:41
    Re: Solution Deployment to another environment

    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: 

     

    Failure details
    Value cannot be null. Parameter name: canvasAppReference
    Operation details
    Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault] Message: Value cannot be null. Parameter name: canvasAppReference
  • K43876 Profile Picture
    37 on 21 Jun 2024 at 19:53:44
    Re: Solution Deployment to another environment

    Same here. Any one?

  • matthhias Profile Picture
    44 on 10 Jun 2024 at 14:25:33
    Re: Solution Deployment to another environment

    Same here. No clue what is causing this issue

  • ErikLm Profile Picture
    17 on 23 May 2024 at 10:37:17
    Re: Solution Deployment to another environment

    Hi @Akanksha09,

     

    I have the exact same problem, have you been able to solve it?

  • JoeFitz Profile Picture
    43 on 15 May 2024 at 13:43:21
    Re: Solution Deployment to another environment

    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".

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,710 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,045 Most Valuable Professional

Leaderboard