web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / MSbuild error while pa...
Power Apps
Answered

MSbuild error while packaging PCF solution - value cannot be null, parameter : type

(0) ShareShare
ReportReport
Posted on by 6

Trying to build and package a PCF control, I could build the control and run in test harness in browser.

But when I create solution and try to package it by running MSBUILD commands, then getting errors.

 

Aura_0-1643204413103.png

 

Attaching full log of creating the control and packaging it here. Been struggling to resolve this so any help is appreciated. 

Thanks

Aura

I have the same question (1)
  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @Aura , 

     

    Maybe the full logs you were writing about could help.

    Have you tried to restore first: "msbuild /t:restore"?

  • Aura Profile Picture
    6 on at

    Hi Diana,

     

    I have attached the log file now. Please have a look and I did use the restore command. It's not able to create a zip file.

     

    Thanks

    Aura

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi  @Aura , 

     

    I use the following restore command

    msbuild /t:restore

    It's a little different than your command. If I saw right, the restore hat errors too.

    Maybe it helps if you try it this way.

     

     

  • Aura Profile Picture
    6 on at

    Hi Diana,

     

    Running msbuild /t:restore completed without any errors but then I could not find the .zip file in bin/debug.

    Tried running Msbuild command again and could see the same error.

    -----------------------------------------------

    C:\Users\JENAAU\source\PCF\Controls\TodoListControl\Solution>msbuild /t:restore
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 27/01/2022 12:39:50.
    Project "C:\Users\JENAAU\source\PCF\Controls\TodoListControl\Solution\Solution.cdsproj" on node 1 (Restore target(s)).
    Restore:
    Committing restore...
    Committing restore...
    Assets file has not changed. Skipping assets file writing. Path: C:\Users\JENAAU\source\PCF\Controls\TodoListControl\Solution\obj\project.assets.json
    Assets file has not changed. Skipping assets file writing. Path: C:\Users\JENAAU\source\PCF\Controls\TodoListControl\obj\project.assets.json
    Restore completed in 47.54 ms for C:\Users\JENAAU\source\PCF\Controls\TodoListControl\Solution\Solution.cdsproj.
    Restore completed in 42.36 ms for C:\Users\JENAAU\source\PCF\Controls\TodoListControl\TodoListControl.pcfproj.

    NuGet Config files used:
    C:\Users\JENAAU\AppData\Roaming\NuGet\NuGet.Config
    C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

    Feeds used:
    https://api.nuget.org/v3/index.json
    Done Building Project "C:\Users\JENAAU\source\PCF\Controls\TodoListControl\Solution\Solution.cdsproj" (Restore target(s)).


    Build succeeded.
    0 Warning(s)
    0 Error(s)

    Time Elapsed 00:00:02.24

     

    Thanks

    Aura

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @Aura , 

     

    Not sure if I can help.  
    I've started an msbuild for one of my projects. If I follow my logs, the point where you get the error is where all the solution components are processed (solution packer).
    Instead if the error,. should follow this messages

    DianaBirkelbach_0-1643294867361.png

    1. Can you please check if under the Solution/src/Other/ folder, you have the Solution,xml, Customizations.xml and Relationships.xml (And they seem valid xmls to you)

     

    2. What "pac" version have you used to create the solution? It's the latest (1.10.4), or an older one?

     

    3. Also, please check that you are executing the "msbuild" inside the solution folder.

     

    4. Just to check that your build cache is not messed up (a desperate step) you could also

    - delete the "obj" folder inside the Solution folder

     - run again "msbuild /t:restore"

     - run again "msbuild"

     

    If it still doesn't work, maybe you try to create another solution in another folder (like Solution1 instead of Solution).


    Hope this helps!

  • Aura Profile Picture
    6 on at

    Hi, 

     

    Thanks for persisting with your help.

    I tried creating a simple control, with just a label field and still the same error. Verified above steps as well. 

    msbuild /t:restore is running fine without any issues but the following msbuild command fails with same errors - 

     

    Aura_0-1643366098093.png

     

    Almost sure that the problem lies with Microsoft libs either PAC or MSBUILD or may be Nuget packages. 

     

    Full log -----------------------

     

    C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution>msbuild
    Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 28/01/2022 10:29:56.
    Project "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\SampleControlSolution.cdsproj" on node 1 (default targets).
    Project "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\SampleControlSolution.cdsproj" (1) is building "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControl1.pcfproj" (2:2) on node 1 (default target
    s).
    PcfBuild:
    npm run build -- --noColor --buildMode development --outDir "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls" --buildSource MSBuild

    > pcf-project@1.0.0 build
    > pcf-scripts build "--noColor" "--buildMode" "development" "--outDir" "C:\\Users\\JENAAU\\source\\PCF\\Controls\\SampleControl1\\out\\controls" "--buildSource" "MSBuild"

    [10:30:04] [build] Initializing...
    [10:30:04] [build] Validating manifest...
    [10:30:04] [build] Validating control...
    [10:30:05] [build] Generating manifest types...
    [10:30:05] [build] Generating design types...
    [10:30:05] [build] Compiling and bundling control...
    [Webpack stats]:
    asset bundle.js 4.22 KiB [emitted] (name: main)
    ./SampleControl1/index.ts 2.67 KiB [built] [code generated]
    webpack 5.67.0 compiled successfully in 1746 ms
    [10:30:08] [build] Generating build outputs...
    [10:30:08] [build] Succeeded
    Done Building Project "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControl1.pcfproj" (default targets).

    ResolveAssemblyReferences:
    Primary reference "SampleControl1".
    Could not find dependent files. Expected file "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls\SampleControl1.exe" does not exist.
    Could not find dependent files. Expected file "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls\SampleControl1.exe" does not exist.
    Resolved file path is "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls\SampleControl1.exe".
    Reference found at search path location "".
    The ImageRuntimeVersion for this reference is "".
    CopyCdsSolutionContent:
    Copying file from "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\src\Other\Customizations.xml" to "obj\Debug\Metadata/Other\Customizations.xml".
    Copying file from "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\src\Other\Solution.xml" to "obj\Debug\Metadata/Other\Solution.xml".
    Copying file from "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\src\Other\Relationships.xml" to "obj\Debug\Metadata/Other\Relationships.xml".
    ProcessCdsProjectReferencesOutputs:
    Processing output of component type: Pcf, source output directory: C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls\, destination directory: C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\obj\D
    ebug\Metadata\Controls
    Process: Output copied from source directory: C:\Users\JENAAU\source\PCF\Controls\SampleControl1\out\controls\SampleControl1 to destination directory: C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\obj\Debug\
    Metadata\Controls\aj_AJSample.SampleControl1
    Process: Control data node created in C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\obj\Debug\Metadata\Controls\aj_AJSample.SampleControl1
    Process: Root Component of type: 66, schema name: aj_AJSample.SampleControl1 added to Solution
    PowerAppsPackage:
    Running Solution Packager to build package type: Unmanaged bin\Debug\SampleControlSolution.zip

    Packing C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\obj\Debug\Metadata to bin\Debug\SampleControlSolution.zip

    C:\Users\JENAAU\.nuget\packages\microsoft.powerapps.msbuild.solution\1.11.4\build\Microsoft.PowerApps.MSBuild.Solution.targets(134,5): error : Value cannot be null. [C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSoluti
    on\SampleControlSolution.cdsproj]
    C:\Users\JENAAU\.nuget\packages\microsoft.powerapps.msbuild.solution\1.11.4\build\Microsoft.PowerApps.MSBuild.Solution.targets(134,5): error : Parameter name: type [C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolutio
    n\SampleControlSolution.cdsproj]
    Done Building Project "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\SampleControlSolution.cdsproj" (default targets) -- FAILED.


    Build FAILED.

    "C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolution\SampleControlSolution.cdsproj" (default target) (1) ->
    (PowerAppsPackage target) ->
    C:\Users\JENAAU\.nuget\packages\microsoft.powerapps.msbuild.solution\1.11.4\build\Microsoft.PowerApps.MSBuild.Solution.targets(134,5): error : Value cannot be null. [C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolu
    tion\SampleControlSolution.cdsproj]
    C:\Users\JENAAU\.nuget\packages\microsoft.powerapps.msbuild.solution\1.11.4\build\Microsoft.PowerApps.MSBuild.Solution.targets(134,5): error : Parameter name: type [C:\Users\JENAAU\source\PCF\Controls\SampleControl1\SampleControlSolutio
    n\SampleControlSolution.cdsproj]

    0 Warning(s)
    1 Error(s)

    Time Elapsed 00:00:12.96

     

    Regards

    Aura

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    .Hi @Aura , 

     

    I'm sorry. I'm running out of ideas.

    Yes, I think it's something with your microsoft.powerapps.msbuild.solution nuget or pac cli .


    Maybe just a few things still.

     

    There is a pac cli version 1.11.3 (maybe you have it already)

     

    pac install latest

     

     

     

    Also, have a look inside C:\Users\JENAAU\.nuget\packages\microsoft.powerapps.msbuild.solution. I have up until version 1.9.9 and  1.11.3. You seem to have a 1.11.4 now. Your first logs were using 1.10.4. 

    https://www.nuget.org/packages/Microsoft.PowerApps.MSBuild.Solution/
    Can you have a look inside the file "1.11.4\build\Microsoft.PowerApps.MSBuild.Solution.targets". Maybe there is something special at line 134 column 5?

     

    I don't think it'll help much, but you could run the msbuild is diagnose mode

     

    msbuild -verbosity:diag

     

    That will produce a lot of output, but maybe you get to see something which can help further.

     

     

     

  • joem Profile Picture
    Microsoft Employee on at

    Hello @Aura ,

     

    Can you do a build of the solution (the *.cdsproj) using the command:

    > msbuild /r /t:build /bl

    The `/bl` will create a binary log file, default name of `msbuild.binlog`.

    This file will help pinpoint the exact location of the error and the task parameters, which is likely where the bug lies.

  • Ign Profile Picture
    Microsoft Employee on at

    Has anyone found an answer to this, i am having the same problem?

  • Ign Profile Picture
    Microsoft Employee on at

    Has no one found a possible work around for this issue yet?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard