Playzor.UserComponents
1.1.0
dotnet add package Playzor.UserComponents --version 1.1.0
NuGet\Install-Package Playzor.UserComponents -Version 1.1.0
<PackageReference Include="Playzor.UserComponents" Version="1.1.0" />
<PackageVersion Include="Playzor.UserComponents" Version="1.1.0" />
<PackageReference Include="Playzor.UserComponents" />
paket add Playzor.UserComponents --version 1.1.0
#r "nuget: Playzor.UserComponents, 1.1.0"
#:package Playzor.UserComponents@1.1.0
#addin nuget:?package=Playzor.UserComponents&version=1.1.0
#tool nuget:?package=Playzor.UserComponents&version=1.1.0
Playzor.UserComponents
The placeholder assembly a Playzor preview runs.
A playground compiles the user's snippet into an assembly named Try.UserComponents and swaps it
in at startup. This package holds the empty stand-in that ships with your app, so the preview has
something to load before the first run — and so the compiled snippet has a matching identity to
replace.
You only need it in the app that renders the preview, next to Playzor.Blazor.Editor.
<script src="_content/Playzor.Blazor.Editor/js/playzor-preview.js"></script>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
Blazor.start({
loadBootResource: function (type, name, defaultUri) {
if (type === 'assembly' && name === 'Try.UserComponents.dll') {
const bytes = window.Playzor?.CodeExecution?.getUserComponentsDllBytes?.();
if (bytes && bytes.length) {
const url = URL.createObjectURL(new Blob([bytes], { type: 'application/octet-stream' }));
return fetch(url).finally(() => URL.revokeObjectURL(url));
}
}
return defaultUri;
}
});
</script>
The snippet declares @page "/__main", so the compiled component simply becomes a route of that
app — nothing else has to be registered. Point the editor's CompiledPreviewUrl at it.
Why the name does not match the package
The assembly stays Try.UserComponents: every snippet saved so far declares
namespace Try.UserComponents in its .cs files, and the boot hook above swaps by exactly that
name. Renaming it would break shared links.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
