[browser] Add test for OutputType=Library #110620
Labels
arch-wasm
WebAssembly architecture
area-Infrastructure-mono
in-pr
There is an active PR which will close this issue when it is merged
os-browser
Browser variant of arch-wasm
Milestone
OutputType=Library
has same publish/deployment story asOutputType=Exe
.It will create
AppBundle
with all necessary JS files.User has to call
dotnet.create()
fromdotnet.js
beforegetAssemblyExports()
is available.The only difference is that this mode doesn't require
Main()
method andrunMain
should fail.We should cover scenarios from #102806 with automated tests
Also discussed in #109866 (comment)
Check if wasi has enough test coverage
Possible use-cases with browser build (described in #102806 for WASI)
1. "I want to create a plain old .NET library"
2. "I want to create a .NET library with access to browser specific APIs"
RuntimeIdentifier
tobrowser-wasm
3. "I want to create a .NET application running in browser and have a meaningful main method" (like Blazor does)
Microsoft.NET.Sdk.WebAssembly
(orMicrosoft.NET.Sdk.BlazorWebAssembly
) SDKRuntimeIdentifier
implicitly set tobrowser-wasm
app bundle
(dotnet.js, .NET runtime, managed dlls)4. "I want to create a .NET application running in browser, but my use-case doesn't have a meaningful main method" (I don't have a single entrypoint into my .NET code, but rather want to call JSExports from JavaScript)
Microsoft.NET.Sdk.WebAssembly
SDKRuntimeIdentifier
implicitly set tobrowser-wasm
app bundle
(dotnet.js, .NET runtime, managed dlls)5. In use-case 4. a situation can occur when two such applications should be hosted on a single page
A.csproj
B.csproj
App.csproj
The text was updated successfully, but these errors were encountered: