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 fails due to i...
Power Apps
Unanswered

msbuild fails due to invalid PCF component. Works in local test harness

(0) ShareShare
ReportReport
Posted on by 9

When running "msbuild /t:build /restore" to package my PCF component, I recieve an error stating that the PCF project that I referenced using "pac solution add-reference" is not a valid component:

 

 

c:\pcfProj\.nuget\packages\microsoft.powerapps.msbuild.solution\1.5.5\build\Microsoft.PowerApps.MSBuild.Solution.targets(104,5): error : Project Reference with output path 'c:\pcfProj\Timeline\CRMTimelineMaster\CRMTimeline\out\controls\', is not a valid PowerApps Component Type [C:pcfProj\Solutions\Timeline\Timeline.cdsproj]

c:\pcfProj\.nuget\packages\microsoft.powerapps.msbuild.solution\1.5.5\build\Microsoft.PowerApps.MSBuild.Solution.targets(104,5): error : Cds component type not supported [C:\pcfProj\Solutions\Timeline\Timeline.cdsproj]

 

 

My project directory has the following structure:

 

pcfProj\
├───BasicTimeline\
├───node_modules\
├───obj\
├───out\controls\BasicTimeline
│ ├───dist\
│ ├───bundle.js
│ └───ControlManifest.xml
└───BasicTimeline.pcfproj, package-lock.json, package.json, & tsconfig.json

 

I've tried changing the "outdir" value in pcfconfig.json to "./out/controls/BasicTimeline" rather than just "./out/controls", but this didn't work.

 

Moreover, the code used to implement the PCF component works correctly in a local test harness using "npm start".

 

Has anyone experienced this issue before and could offer troubleshooting suggestions?

I have the same question (0)
  • RajYRaman Profile Picture
    270 on at

    @jwen25 - When you run "pac solution add-reference" you are actually adding a reference to your pcfproj file inside the cdsproj file on the solution folder. I have my folder setup like below

     

     

    ├── QR Code.pcfproj
    ├── QRCode
    │ ├── ControlManifest.Input.xml
    │ ├── QRCode.tsx
    │ ├── generated
    │ │ └── ManifestTypes.d.ts
    │ └── index.ts
    ├── README.md
    ├── Solution
    │ └── PCFQRCode
    │ ├── Other
    │ ├── PCFQRCode.cdsproj
    │ ├── bin
    │ └── obj
    ├── out
    │ └── controls
    │ └── QRCode
    ├── package-lock.json
    ├── package.json
    ├── pcfconfig.json
    └── tsconfig.json

     

     

    So, I run "pac solution add-reference -p ../../" from the Solution/PCFQRCode folder. Once I do this I can also verify by opening the cdsproj file and confirm that the reference is there.

     

    rajyraman_0-1618291833093.png

    Just check what the reference is in your cdsproj file. I had no issues in running msbuild, so I could not reproduce this issue. 

  • jwen25 Profile Picture
    9 on at

    Thanks @rajyraman. I was playing around with the "BasicTimeline.pcfproj" project file yesterday and found that changing the Microsoft.PowerApps.MSBuild.Pcf package reference version from "0.*" to "1.*" caused msbuild to run successfully and package my component into a zip file.

     

    Originally, my pcfproj file had the following structure:

    <ItemGroup>
    <PackageReference Include="Microsoft.PowerApps.MSBuild.Pcf" Version="0.*"/>
    </ItemGroup>


    After I changed the version attribute to "1.*", msbuild ran successfully.

     

    Thanks again for your help!

  • Pavan Deepala Profile Picture
    32 on at

    @jwen25 Thanks for sharing that worked for me as well. I think the backward compatibility is missing in msbuild newer version.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard