Skip to content

Wasm for updated nuget reference not updated on build #62031

Open
@innominateAtWork

Description

@innominateAtWork

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Steps:

  1. Create "Blazor Web Assembly Standalone App" via new project template.
  2. Add a reference to the csproj file <PackageReference Include="MudBlazor" Version="8.0.0" />
  3. Add code in Home.razor to output the version number
Mud Blazor Version: @GetVersion()

@code {
    public static string? GetVersion()
    {
        var assembly = typeof(MudBlazor.MudButton).Assembly;
        var infoVer = assembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).OfType<AssemblyInformationalVersionAttribute>().FirstOrDefault();
        return infoVer?.InformationalVersion ?? "Unknown";
    }
}
  1. Build and run. The version number 8.0.0 will output as expected.
  2. Change the csproj reference to <PackageReference Include="MudBlazor" Version="8.6.0" />
  3. Build and run. The version number being output is still 8.0.0 the wasm for the latest version was not loaded.
  4. Browser cache clears dont help.
  5. In order to get the latest version a ReBuild is required.

I followed steps 1-6 and put the files (including bin / obj) into a zip here:
https://github.com/innominateAtWork/BlazorOldWasmBuildIssue

I can see that doing a build does not update the file "\BlazorApp1\bin\Debug\net8.0\wwwroot_framework\MudBlazor.wasm" while doing a rebuild does.

Expected Behavior

A build should cause the latest code from assemblies referenced via nuget to be included

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions