cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Production PCF bundling in unmanaged solution?

We need to include a PCF component in a bigger suite. We don't want to have a dependency on the PCF solution, so I need to make an unmanaged Solution for my PCF, in order to make it possible to include it in the suite solution.

When I build the solution unmanaged using "msbuild" I get a zip size of 214KB.

The solution build  using "msbuild /p:configuration=Release" it's only 47KB, but I can use that only for managed solutions.

That can make a big difference in the performance.

Is there a way to generate an unmanaged solution with production bundling (without having to modify the generated zip manually)?

Best regards,

Diana

1 ACCEPTED SOLUTION

Accepted Solutions
Resolver I
Resolver I

@DianaBirkelbach ,

 

Modifying the .cdsproj like below should output the managed and unmanaged zip files during the msbuild process.

 

Create Both Solution TypesCreate Both Solution Types

 

When i look at the files sizes in the bin\Release folder they are the same.

 

-Rick

View solution in original post

8 REPLIES 8
Resolver I
Resolver I

@DianaBirkelbach ,

 

Modifying the .cdsproj like below should output the managed and unmanaged zip files during the msbuild process.

 

Create Both Solution TypesCreate Both Solution Types

 

When i look at the files sizes in the bin\Release folder they are the same.

 

-Rick

View solution in original post

I always build using Release mode and output as an Unmanaged solution. This way you can import your component ready for export via either the same solution - or another larger solution that includes multiple components.

 

The Development build is then used only for local debug. I don't see any reason to import your component to CDS as a development build.

Thank you Rick!

I must admit that I couldn't understand the documentation right. I was also confused because the default cdsproj configuration delivers unmanaged for "msbuild", and managed for "msbuild /p:configuration=Release", both solutions having the same name (no "managed" in the name). 

In case somebody else has the same problem, I've write a blog about this: https://dianabirkelbach.wordpress.com/2020/04/28/pcf-solution-packaging-unmanaged-for-production-rel...

Thanks again @RAWilson  and @ScottDurow  for your help.

Best regards,

Diana

@ScottDurow @DianaBirkelbach 

How do we debug our controls in development environment if we build the solution in release mode.

@ScottDurow @DianaBirkelbach 

How do we debug our controls in development environment if we build the solution in release mode.

You can use Fiddler to redirect the loading of the bundle.js to your local version that is build using npm start watch!

 

Hope this helps

New Member

Ok, got it, the 'Both' option is pretty nice and gives as an optimized unmanged solution. But how to tell 'pac pcf push' what to deploy into the target system? How does it know whether to deploy a optimized/unoptimized output or manged/unmanaged solution?

Hi  @Martype , 

 

"pac pcf push" is supposed to be used only during development, so it uploads the debug version. That is called while you are in the "PCF-Project" folder.

 

When the development is done, you should use the "Solution Project" and call "msbuild" (with or without /p:configuration=Release). This will generate a Solution zip, which you can deploy like any other Solution import.

 

Hope it helps!

Kind regards,

Diana

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (11,292)