ICT

[Power Platform] Powerapp Component PCF Push Error in Visual Studio Code

NeoSailer 2024. 11. 7. 16:13

[Scenario]

After building Powerapp component via Visual Code, it was unable to push the component to Azure environment with the error as below

You must install or update .NET to run this application.
App: C:\Program Files\dotnet\sdk\7.0.120\dotnet.dll
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.20' (x64)
.NET location: C:\Program Files\dotnet\
The following frameworks were found:
  8.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  8.0.10 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.20&arch=x64&rid=win-x64&os=win10
Microsoft PowerPlatform CLI
Version: 1.35.1+g0c2637a
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: Building temporary solution wrapper: failed. See obj\pcf-push-build.log for more details.

 

[Objectives]

Figure out the error and push the Power App component to the environment, Rotork Personal Projectivity

 

[Remediation]

Manipulated ChatGPT by coping the error message and asked to the AI.

 

ChatGPT says:

 

It looks like the .NET runtime version required by the Power Platform CLI (version 7.0.20) is missing from your machine, which is why you're encountering this error during the pcf push process. Here’s how to resolve it:

 

Install the required .NET version:

  • Go to this link to download the required .NET runtime (version 7.0.20).
  • Install it by following the installation instructions on the site.

 

As instructed, went to the link and then installed .NET runtime 7.0.20.

 

It works!

 

PS C:\SRE\PL-400\NewComponentProject\source\editable-pcf> pac pcf push --publisher-prefix msl
Connected as Jaehui.Yoon@rotork.com
Connected to... Rotork Personal Productivity
Using publisher prefix 'msl'.
Checking if the control 'msl_SampleNamespace.EditablePCF' already exists in the current org.
Using full update.
Creating a temporary solution wrapper to push the component.
Building the temporary solution wrapper.
-
Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.120

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
C:\Program Files\dotnet\sdk\7.0.120\MSBuild.dll -nologo --property:PcfForceUpdate=true -property:Configuration=Debug -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\7.0.120\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\7.0.120\dotnet.dll -fileLoggerParameters:LogFile=C:\SRE\PL-400\NewComponentProject\source\editable-pcf\obj\pcf-push-build.log;Verbosity=detailed;Encoding=UTF-8 -maxcpucount -restore -target:Rebuild -verbosity:m -verbosity:minimal /bl:C:\SRE\PL-400\NewComponentProject\source\editable-pcf\obj\pcf-push-build.binlog .\PowerAppsToolsTemp_msl.cdsproj
  Determining projects to restore...
  Restored C:\SRE\PL-400\NewComponentProject\source\editable-pcf\obj\PowerAppsToolsTemp_msl\PowerAppsToolsTemp_msl.cdsproj (in 15.88 sec).
  Restored C:\SRE\PL-400\NewComponentProject\source\editable-pcf\editable-pcf.pcfproj (in 15.88 sec).
  
  > pcf-project@1.0.0 clean
  > pcf-scripts clean --noColor --buildMode development --outDir C:\SRE\PL-400\NewComponentProject\source\editable-pcf\out\controls --buildSource MSBuild

  [?ㅽ썑 3:41:08] [clean]  Initializing...
  [?ㅽ썑 3:41:08] [clean]  Cleaning build outputs...
  [?ㅽ썑 3:41:08] [clean]  Succeeded
  Cleaning output directory: bin\Debug\, Intermediate directory: obj\Debug\ and Solution Packager working directory: obj\Debug\
  Removing log file: obj\Debug\SolutionPackager.log and generated solution package: bin\Debug\PowerAppsToolsTemp_msl.zip
  
  > pcf-project@1.0.0 build
  > pcf-scripts build --noColor --buildMode development --outDir C:\SRE\PL-400\NewComponentProject\source\editable-pcf\out\controls --buildSource MSBuild

  [?ㅽ썑 3:41:14] [build]  Initializing...
  [?ㅽ썑 3:41:14] [build]  Validating manifest...
  [?ㅽ썑 3:41:14] [build]  Validating control...
  [?ㅽ썑 3:41:15] [build]  Generating manifest types...
  DeprecationWarning: 'createInterfaceDeclaration' has been deprecated since v4.8.0. Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter.
  [?ㅽ썑 3:41:15] [build]  Generating design types...
  [?ㅽ썑 3:41:15] [build]  Running ESLint...
  [?ㅽ썑 3:41:17] [build]  Compiling and bundling control...
  [Webpack stats]:
  asset bundle.js 7.86 KiB [emitted] (name: main)
  runtime modules 670 bytes 3 modules
  ./EditablePCF/index.ts 4.63 KiB [built] [code generated]
  webpack 5.96.1 compiled successfully in 2224 ms
  [?ㅽ썑 3:41:20] [build]  Generating build outputs...
  [?ㅽ썑 3:41:20] [build]  Succeeded
  Running Solution Packager to build package type: Unmanaged bin\Debug\PowerAppsToolsTemp_msl.zip

Packing C:\SRE\PL-400\NewComponentProject\source\editable-pcf\obj\PowerAppsToolsTemp_msl\obj\Debug\Metadata to bin\Debug\PowerAppsToolsTemp_msl.zip

Processing Component: Entities
Processing Component: Roles
Processing Component: Workflows
Processing Component: FieldSecurityProfiles
Processing Component: Templates
Processing Component: EntityMaps
Processing Component: EntityRelationships
Processing Component: OrganizationSettings
Processing Component: optionsets
Processing Component: CustomControls
 - SampleNamespace.EditablePCF
Processing Component: SolutionPluginAssemblies
Processing Component: EntityDataProviders
Processing Sharded Component Files

Unmanaged Pack complete.

  Solution: bin\Debug\PowerAppsToolsTemp_msl.zip generated.
  Solution Package Type: Unmanaged generated.
  Completed intermediate files clean up.

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:32.72
Building temporary solution wrapper: done.
Importing the temporary solution wrapper into the current org.

Solution Importing...

Solution Imported successfully.
Importing the temporary solution wrapper into the current org: done.

Publishing All Customizations...

Published All Customizations.
Updating the control in the current org: done.

 

The component is seen in the solution list.

 

 

Finally ChatGPT has been grown as a practical helper.

반응형