Skip to content

Wasm for updated nuget reference not updated on build #62031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
innominateAtWork opened this issue May 20, 2025 · 2 comments
Open
1 task done

Wasm for updated nuget reference not updated on build #62031

innominateAtWork opened this issue May 20, 2025 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components investigate
Milestone

Comments

@innominateAtWork
Copy link

innominateAtWork commented May 20, 2025

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

@github-actions github-actions bot added the area-blazor Includes: Blazor, Razor Components label May 20, 2025
@javiercn
Copy link
Member

@innominateAtWork thanks for contacting us.

Does removing the bin and obj folders address the issue?

/cc: @maraf

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label May 21, 2025
@innominateAtWork
Copy link
Author

Yes, deleting bin and obj folders and then building causes the latest version to be used.

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 21, 2025
@javiercn javiercn added investigate and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels May 21, 2025
@javiercn javiercn added this to the Backlog milestone May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components investigate
Projects
None yet
Development

No branches or pull requests

2 participants