Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

Support .NET `-browser` target framework moniker

Open Joppe27 opened this issue 8 months ago • 0 comments

Feature Request

The -browser TFM was created in .NET 8 (e.g. <TargetFramework>net8.0-browser</TargetFramework>). It is used in web assembly apps to facilitate access to browser-specific APIs (see design document). Oryx does not seem to support this TFM yet, which causes it to detect an incorrect .NET version, failing the build.

Logs (using <TargetFramework>net9.0-browser</TargetFramework>):

Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
---Oryx build logs---


Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20241003.1, Commit: d5352431d933306ccee1be9b5d822c73bf723e9e, ReleaseTagName: 20241003.1

Build Operation ID: 
OS Type           : bullseye
Image Type        : githubactions

Detecting platforms...
Detected following platforms:
  dotnet: 6.0.35
Version '6.0.35' of platform 'dotnet' is not installed. Generating script to install it...


Downloading and extracting 'dotnet' version '6.0.427' to '/tmp/oryx/platforms/dotnet/6.0.427'...
Detected image debian flavor: bullseye.
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: dotnet...
Done in 5 sec(s).


Using .NET Core SDK Version: 6.0.427
"2025-03-29 14:07:44"|ERROR|
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.427

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
--------------------------------------------------------------------------------------
error MSB4236: The SDK 'Microsoft.NET.Sdk.WebAssembly' specified could not be found. | 1 | Please build your app locally before publishing. | https://docs.microsoft.com/en-us/azure/app-service/configure-language-dotnetcore?pivots=platform-linux


---End of Oryx build logs---
Oryx has failed to build the solution.

Importantly, building the exact same project with <TargetFramework>net9.0</TargetFramework> detects the correct version and works without issues. Could this be investigated?

Joppe27 avatar Mar 29 '25 15:03 Joppe27