Skip to content

Diagnostic Extension Causes System.AccessViolationException #99

Description

@JRWolford

When using Unity with the WebApplicationBuilder in .NET 8, adding the Diagnostic extension causes a System.AccessViolationException.

I noticed this when migrating our .NET Framework 4.8 app to .NET 8 and I haven't really found anything posted about it yet so I figured I would bring it to your attention.

This works:

var builder = WebApplication.CreateBuilder(args);
builder.Host.UseUnityServiceProvider();

This causes the issue:

var builder = WebApplication.CreateBuilder(args);
builder.Host.UseUnityServiceProvider(new UnityContainer().AddExtension(new Diagnostic()));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions