Tech Community Live: Windows edition
Jun 05 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community

How to packaged include .net runtime?

Copper Contributor

Hi

   My application build with WinUI3+ .NET 6. 

   I packaged with MSIX,  and run  on the new PC.  show this:

liuyan300_0-1675220301177.png

My project files(.csproj):

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>Assets\logo\64.ico</ApplicationIcon>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<DefaultLanguage>zh-CN</DefaultLanguage>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateThumbprint>xxxxxxxx</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
</PropertyGroup>

 

 

1 Reply

Hi @liuyan300

 

You may need to add .NET as a dependency within the package.

 

You can read more about it here - PackageDependency (Windows 10) - Windows UWP applications | Microsoft Learn

 

In case you're not able to make it work, let us know.

 

Aniket