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

Notifications

Announcements

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)
  • mrc2018 Profile Picture
    6 on at

    I also encountered this error on running msbuild, but I do not agree with the accepted solution as this was encountered even when using the Developer Command Prompt for VS 2019 and with msbuild added to the path. So I don't believe it is a path issue.

     

    I managed to narrow down the error to the value/property which is null. This is the "SolutionPackageMapFilePath" passed to the SolutionPackagerTask within the Microsoft.PowerApps.MSBuild.Solution.Targets file:

     

    mrc2018_0-1702307163644.png

     

    I printed out the vars using the <Message /> tag:

    mrc2018_1-1702307205755.png

    As one can see the MappingFilePath and LocalTemplate are essentially null values. Based on tests, the former value cannot be null or absent for whatever reason. The error only goes away when one supplies an actual path to a Map.xml file. However, this opens a can of worms in terms of getting into how to configure and use mapping files for the build. There doesn't seem to be an option to say no to using a mapping file in this version of the pac client.

     

    However, since the built files are still created and added to Solutions\PCF_HelloWorld\obj\Debug\Metadata (where "PCF_HelloWorld" is the name of your component) one can apply the pac solution pack command to still create the final zip file required for upload to the Solutions PowerApps portal. For example:

     

    pac solution pack -z C:\Users\Public\Documents\User\PowerAppComponents\Solutions\PCF_HelloWorld\bin\Debug\HelloWorld.zip -f C:\Users\Public\Documents\User\PowerAppComponents\Solutions\PCF_HelloWorld\obj\Debug\Metadata

     

    I propose this as a work-around rather than a direct solution therefore. Of course if anyone else can shed any light on this error (@DianaBirkelbach@joem , @cchannon , @Aura@mick4 ) I would be very interested.

     

    Many thanks

     

     

  • cchannon Profile Picture
    4,702 Moderator on at

    Ah, yeah, that's a PATH issue. You can get around it by adding the correct msbuild to PATH (you might have multiple installed if you have more than one Visual Studio version installed). Good to hear you sorted it out!

  • Verified answer
    AdnanDev Profile Picture
    30 on at

    So I was also having this issue but it was resolved using developer command prompt of Visual Studio. Otherwise you can go through these steps it will work too. (Solved) msbuild is not recognized as an internal or external command, operable program or batch file while working with PCF – Softchief Training

  • cchannon Profile Picture
    4,702 Moderator on at

    Just a guess, but did you remember to use "pac solution add-reference"?

  • joem Profile Picture
    on at

    The original post does not contain enough information to debug.

    I tried to repro using the same steps as in the original post's docx file, and I did not get any build error.

    It is likely that the user's repo has some incompatible build customizations. But not able to determine this unless we get the full build log file.

    Please rerun the msbuild command, adding "/bl" to save the binary log file (*.binlog in the current directory).

  • mick4 Profile Picture
    2 on at

    Anyone found a solution to this issue, any suggestions much appreciated! 

  • Community Power Platform Member Profile Picture
    on at

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

  • linu John Profile Picture
    2 on at

    any solution for this problem ? i am facing same issue .

  • joem Profile Picture
    on at

    A binary log file would be preferred to debug. Please rerun your build (via dotnet or msbuild CLI) and add the "/bl" argument. This will create a *.binlog file in the current directory.

  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 401

#2
WarrenBelz Profile Picture

WarrenBelz 334 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 325 Super User 2025 Season 2

Last 30 days Overall leaderboard