question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When making a bundle project, building fails when InstallerRuntimeIdentifiers is manually set inside.

See original GitHub issue
  • This issue is blocking
  • This issue is causing unreasonable pain

For some reason I been hitting this issue when experimenting with making an installer bundle similar to those found in dotnet/runtime using the arcade package Microsoft.DotNet.Build.Tasks.Installers.

The issue happens on this line:

https://github.com/dotnet/arcade/blob/943d03f62955c771825dfa1f1bdeb8f853a2d7dd/src/Microsoft.DotNet.Build.Tasks.Installers/build/installer.targets#L85-L86

The following is what is in my bundleproj file:

<Project Sdk="Microsoft.Build.NoTargets/3.2.9">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AssemblyVersion />
    <!--
      Name, used to generate the bundle upgrade code. Must stay the same to allow bundles in a given
      product band to upgrade in place.
    -->
    <BundleInstallerUpgradeCodeSeed>Elskom Shared Framework Bundle Installer</BundleInstallerUpgradeCodeSeed>
    <BundleThemeDirectory>$(MSBuildProjectDirectory)</BundleThemeDirectory>
    <ArchiveName>elskom-runtime</ArchiveName>
    <InstallerName>elskom-runtime</InstallerName>
    <InstallerRuntimeIdentifiers>win-x86;win-x64;win-arm64;osx-x64;osx-arm64</InstallerRuntimeIdentifiers>
    <BundleNameSuffix>Runtime</BundleNameSuffix>
    <ProductBrandPrefix>Elskom</ProductBrandPrefix>
    <MacOSBundleTemplate>$(MSBuildProjectDirectory)/shared-framework-distribution-template-$(TargetArchitecture).xml</MacOSBundleTemplate>
    <MacOSBundleIdentifierName>com.elskom.dotnet.Elskom.Sdk.App.$(ProductVersion).osx.$(TargetArchitecture)</MacOSBundleIdentifierName>
    <MacOSBundleResourcesPath>osx_resources</MacOSBundleResourcesPath>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="*-*" />
    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" Version="*-*" />
    <BundleComponentReference Include="../sfx/Elskom.Sdk.App.sfxproj" />
    <BundleComponentReference Include="../sfx/Elskom.Sdk.App.Ref.sfxproj" />
  </ItemGroup>

  <Target Name="PublishToDisk">
    <Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />
    <MSBuild Projects="@(BundleComponentReference)" Targets="PublishToDisk" Properties="OutputPath=$(OutputPath)" />
  </Target>

  <!-- <Target Name="PublishSymbolsToDisk">
    <Error Condition="'$(SymbolsOutputPath)' == ''" Text="Publishing to disk requires the SymbolsOutputPath to be set to the root of the path to write to." />
    <MSBuild Projects="@(BundleComponentReference)" Targets="PublishSymbolsToDisk" Properties="SymbolsOutputPath=$(SymbolsOutputPath)" />
  </Target> -->

</Project>

Perhaps that line can be made to not error when InstallerRuntimeIdentifiers is set, it seems to also happen if I set RuntimeIdentifiers only as well.

I been doing this sort of experiments with the arcade stuff to learn more about what was done to set up creating them for the normal .NET SDK / Runtime installers in the first place. When I done this I expected it to just work like I see with the runtime repository. Perhaps I am missing something I have not seen yet from the runtime repository which might explain why this just fails for some reason.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
AraHaancommented, Jan 14, 2022

Yes, it’s part of a runtime people can have their programs depend on. And it’s located at https://github.com/Elskom/runtime/ It contains useful things that can be used by anyone including MiniDumping, plugin loading, encryption/decryption (blowfish), a packaging command for a gui application so it can package itself (and dependencies that get copied directly to their build output folder) into a zip file for distribution, reading embedded git metadata (generated from a source generator I created that goes with that runtime in a way), an lua 5.1~5.2 decompiler library, and an semi broken (currently checked to be broken on macos) zlib implementation.

The above that gets packaged together into an installer is useful for not just normal developers, but also for developers of games as well (as they can use it to pack their game files) without them needing to implement similar things themselves.

0reactions
NikolaMilosavljeviccommented, Jan 14, 2022

Thanks @AraHaan. We don’t support building multiple RIDs at once. We build .NET runtimes for a single RID only. It simplifies deployment as most customers need those individual runtimes., most often a machine native one.

You shared what you’d like to see implemented and how that affects your build system. However, it would be helpful to get a complete picture of your plans. Is this all for a sample/test project, and you were experimenting with installers, or is this for a product that ships to customers? How many customers and if this is open source on GitHub, can you share the link?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS 15.8.2 broke build tools - missing RuntimeIdentifier
Solution is to manually pass -MsBuildPath to NuGet and set it to what ... I try to build a solution via msbuild without...
Read more >
.NET Native Library Packaging (RuntimeIdentifiers, build, ...
Create a nuget package vincenzoml/SimpleITK-dotnet-quickstart#1; "Add a way to list native assets that a project will load from the app ...
Read more >
Projects fail to build in 15.8.0 due to errors from Microsoft. ...
I have several projects that are now failing to build in 15.8. Both were building in 15.7. These projects don't have any NuGet...
Read more >
Project property settings in Visual Studio - .NET MAUI
Describes the Visual Studio project properties available to a .NET MAUI app. The properties and settings are related to building the app, ...
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This error occurs when you attempt to build a project that contains references to one or more NuGet packages, but those packages are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found