cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DianaBirkelbach
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

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
1 ACCEPTED SOLUTION

Accepted Solutions
RAWilson
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
RAWilson
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

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@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

Martype
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

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,418)