Skip to content

ManagedToNativeGenerator is invoked on every build #122575

@AdmiralSnyder

Description

@AdmiralSnyder

Description

ManagedToNativeGenerator in WasmApp.Common.targets is called too often, even if no source code changed.

this results a) in a time loss when building or hitting F5 in VS and
b) in my case lots of unnecessary warnings obscuring actual warnings:

Image

Reproduction Steps

create a blazor wasm project
run dotnet build -bl
run dotnet build -bl a second time without modifying files in between runs
, inspect the binlog
, observe that ManagedToNativeGenerator is there, eating up time unnecessarily

Image

here's my .csproj:

SAK SAK SAK SAK $(CODie__DotNetVersion) true Default service-worker-assets.js

Expected behavior

this should only run when something has actually changed in the inputs

Actual behavior

it runs on every build

Regression?

No response

Known Workarounds

No response

Configuration

.net 10.0.0.101
windows 11 pro 25h2 26200.7462
VS 2026 18.1.0

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions