Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

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

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:


│ ├───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?


@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
├── 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.



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

Frequent Visitor

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:

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

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


Thanks again for your help!

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,329)