DotNetBrowser.Branding
1.0.2
Prefix Reserved
dotnet add package DotNetBrowser.Branding --version 1.0.2
NuGet\Install-Package DotNetBrowser.Branding -Version 1.0.2
<PackageReference Include="DotNetBrowser.Branding" Version="1.0.2" />
<PackageVersion Include="DotNetBrowser.Branding" Version="1.0.2" />
<PackageReference Include="DotNetBrowser.Branding" />
paket add DotNetBrowser.Branding --version 1.0.2
#r "nuget: DotNetBrowser.Branding, 1.0.2"
#:package DotNetBrowser.Branding@1.0.2
#addin nuget:?package=DotNetBrowser.Branding&version=1.0.2
#tool nuget:?package=DotNetBrowser.Branding&version=1.0.2
DotNetBrowser.Branding
DotNetBrowser.Branding is a NuGet package that applies custom branding to
DotNetBrowser Chromium binaries during dotnet publish.
The package includes built-in Chromium extraction tasks, so it works as a single-package branding solution.
Installation
<ItemGroup>
<PackageReference Include="DotNetBrowser.Branding" Version="x.y.z" />
</ItemGroup>
Quick Start
Add the following to your project file:
<PropertyGroup>
<DotNetBrowserBrandingEnabled>true</DotNetBrowserBrandingEnabled>
<DotNetBrowserBrandingParamsFile>$(MSBuildProjectDirectory)\branding.params.json</DotNetBrowserBrandingParamsFile>
</PropertyGroup>
Then publish:
dotnet publish -c Release
Repacking Into a Runtime-Extractable Container
By default, branding outputs a plain directory of Chromium binaries. If your app runs from a mapped network drive or UNC path, that means every Chromium file has to be shipped and verified individually. Enable repacking to pack the branded binaries back into the same compact container format DotNetBrowser normally uses, so it can be extracted to a local per-user directory at runtime instead:
<PropertyGroup>
<DotNetBrowserBrandingEnabled>true</DotNetBrowserBrandingEnabled>
<DotNetBrowserBrandingParamsFile>$(MSBuildProjectDirectory)\branding.params.json</DotNetBrowserBrandingParamsFile>
<DotNetBrowserBrandingRepackEnabled>true</DotNetBrowserBrandingRepackEnabled>
</PropertyGroup>
This only works when the branding source is a Chromium container assembly
(DotNetBrowser.Chromium.<Platform>.dll), not an already-unpacked directory. The repacked
assembly must keep the same file name as the original, so make sure your app deploys and loads it
from the DotNetBrowserBrandingRepackDestinationPath output (default:
$(PublishDir)branded-container/) in place of the original one.
Repacking changes the assembly's bytes, which invalidates any Authenticode signature the original
assembly carried. Set DotNetBrowserBrandingRepackSignCommand (same @@BINARY_PATH@@ placeholder
convention as branding.params.json's signCommand) to re-sign the repacked assembly if required.
Do not embed a certificate password or token directly in that command. The command text is never written to the build log, but MSBuild records task inputs in binary logs and at diagnostic verbosity, and the command is handed to a shell, so it is visible in the machine's process list while it runs. Reference the certificate by thumbprint or store instead, or have the invoked script read the secret from an environment variable:
<DotNetBrowserBrandingRepackSignCommand>signtool sign /sha1 <thumbprint> /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 "@@BINARY_PATH@@"</DotNetBrowserBrandingRepackSignCommand>
Extraction Support Inside Branding
DotNetBrowser.Branding includes extraction tasks internally. If your source is
DotNetBrowser.Chromium*.dll, extraction runs automatically before branding.
You can also enable standalone extraction targets from this package:
<PropertyGroup>
<DotNetBrowserExtractionEnabled>true</DotNetBrowserExtractionEnabled>
<DotNetBrowserExtractionDuringPublish>true</DotNetBrowserExtractionDuringPublish>
</PropertyGroup>
These properties use the same contract as the
DotNetBrowser.Chromium.Extraction package.
branding.params.json Example
{
"version": "1.2.3",
"win": {
"executableName": "myapp",
"processDisplayName": "My App",
"legalCopyright": "© 2025 MyCompany",
"author": "Me",
"productName": "MyApp",
"icoPath": "assets/app.ico",
"signCommand": "echo @@BINARY_PATH@@"
},
"mac": {
"bundle": {
"name": "MyApp",
"id": "com.mycompany.myapp"
},
"icnsPath": "assets/app.icns",
"codesignIdentity": "${CODESIGN_IDENTITY}",
"codesignEntitlements": "assets/entitlements.plist",
"teamID": "${TEAM_ID}",
"appleID": "${APPLE_ID}",
"password": "${PASSWORD}"
},
"linux": {
"executableName": "myapp"
}
}
Branding Properties
DotNetBrowserBrandingEnabledDefault:false.DotNetBrowserBrandingParamsFileRequired when branding is enabled.DotNetBrowserBrandingSourcePathDefault:$(PublishDir).DotNetBrowserBrandingDestinationPathDefault:$(PublishDir)branded/.DotNetBrowserBrandingToolPathOptional explicit path tochromium_branding.DotNetBrowserBrandingToolArgumentsOptional custom arguments with placeholders:{source},{destination},{params}.DotNetBrowserBrandingWorkingDirectoryOptional working directory for tool execution.DotNetBrowserBrandingStageAssetsDefault:true.DotNetBrowserBrandingAssetsBasePathDefault: directory ofDotNetBrowserBrandingParamsFile.DotNetBrowserBrandingKeepTemporaryExtractionDefault:false.DotNetBrowserBrandingRepackEnabledDefault:false. Packs branded binaries back into a runtime-extractable container. See Repacking Into a Runtime-Extractable Container.DotNetBrowserBrandingRepackDestinationPathDefault:$(PublishDir)branded-container/.DotNetBrowserBrandingRepackKeepDirectoryOutputDefault:true. Set tofalseto remove the plain-directory branded output once the container has been produced successfully.DotNetBrowserBrandingRepackSignCommandOptional command to re-sign the repacked assembly. Supports the@@BINARY_PATH@@placeholder. Must not embed credentials - see the note under "Repacking" above. The invoked tool's output is logged at low verbosity unless the command fails.
Shared Extraction Properties
DotNetBrowserExtractionEnabledDotNetBrowserExtractionDuringBuildDotNetBrowserExtractionDuringPublishDotNetBrowserExtractionSourcePathDotNetBrowserExtractionDestinationPath
Notes
- Branding runs after
Publish. - For best results, run publish and branding on the target operating system.
- The final output path is logged as
DotNetBrowserBrandedOutputPath.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.