IntraDotNet.AspNetCore.Wasm 1.0.2

dotnet add package IntraDotNet.AspNetCore.Wasm --version 1.0.2
                    
NuGet\Install-Package IntraDotNet.AspNetCore.Wasm -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IntraDotNet.AspNetCore.Wasm" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IntraDotNet.AspNetCore.Wasm" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="IntraDotNet.AspNetCore.Wasm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IntraDotNet.AspNetCore.Wasm --version 1.0.2
                    
#r "nuget: IntraDotNet.AspNetCore.Wasm, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IntraDotNet.AspNetCore.Wasm@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IntraDotNet.AspNetCore.Wasm&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=IntraDotNet.AspNetCore.Wasm&version=1.0.2
                    
Install as a Cake Tool

IntraDotNet.AspNetCore.Wasm

WebAssembly polyfill for enabling Windows features when targeting an intranet environment.

Features

  • Browser console logging
  • HTTP request handling with browser credentials

Installation

To install the package using the dotnet CLI, run the following command:

dotnet add package IntraDotNet.AspNetCore.Wasm

Usage

Browser Console Logging

You can add browser console logging to your ASP.NET Core application by using the AddBrowserConsole extension method.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using IntraDotNet.AspNetCore.Wasm.BrowserConsole;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Logging.AddBrowserConsole();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}

app.UseHttpsRedirection();

app.Run();
Configuration

You can configure the logging level in your appsettings.json file:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "None",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  }
}

HTTP Request Handling with Browser Credentials

You can use the BrowserIncludeRequestCredentialsDelegatingHandler to include browser request credentials in your HTTP requests. Register the handler with dependency injection and use it in your services.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Net.Http;
using IntraDotNet.AspNetCore.Wasm.Fetch;

var builder = WebApplication.CreateBuilder(args);

//Add AddBrowserIncludeRequestCredentials to the HttpClient builder
//See example project, Pages/Home.razor for an example of using HttpClient with this handler
builder.Services.AddHttpClient("MyClient")
    .ConfigurePrimaryHttpMessageHandler<BrowserIncludeRequestCredentialsDelegatingHandler>();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}

app.UseHttpsRedirection();

app.Run();

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 83 6/7/2025
1.0.1 171 12/18/2024
1.0.0 108 12/17/2024