Skip to content

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Apr 11, 2025

Fixes #35207
Fixes #35196

@maraf ... I confirmed that our guidance on changing DLL extensions when Webcil is disabled is broken 💥. Why it's broken is unclear beyond the runtime failing to start with a console error message to the effect [MONO] * Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:2718, condition '<disabled>' not met.

On this PR, I'm versioning the guidance out for 8.0 or later, when Webcil took over. Unlike the troubleshoot integrity PowerShell script, I'm not going to open an issue to determine if we should devise new DLL extension change guidance. For one thing since the release of .NET 8, no issues have been opened on the docs repo or on the ASP.NET Core product unit repo asking about changing DLL file extensions or blocked Webcil (.wasm) files. Let me know if you'd like to have such an issue opened, but it would be up to the PU to work out the procedure for .NET 8 or later apps, including any deltas across versions since the release of .NET 8. I'd prefer not to open such an issue if it's going to sit here for years ... which unfortunately happens 😄.

... and sorry for all of the commit pings. I thought this would go in fairly easily, but the coverage is tricky to get just right.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/host-and-deploy/index.md aspnetcore/blazor/host-and-deploy/index
aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout.md aspnetcore/blazor/host-and-deploy/webassembly/deployment-layout
aspnetcore/blazor/host-and-deploy/webassembly/iis.md aspnetcore/blazor/host-and-deploy/webassembly/iis
aspnetcore/blazor/host-and-deploy/webassembly/index.md aspnetcore/blazor/host-and-deploy/webassembly/index
aspnetcore/blazor/webassembly-lazy-load-assemblies.md aspnetcore/blazor/webassembly-lazy-load-assemblies

@guardrex guardrex self-assigned this Apr 11, 2025
@guardrex guardrex merged commit 9d68074 into main Apr 11, 2025
3 checks passed
@guardrex guardrex deleted the guardrex/blazor-ext-change-updates branch April 11, 2025 15:29
@maraf
Copy link
Member

maraf commented Apr 12, 2025

@guardrex It sounds weird. Switching off webcil should work and in runtime we have tests that stretches it.

Could you please open an issue in dotnet/runtime ideally with the repro that you tested on. Please ping me there.

@guardrex
Copy link
Collaborator Author

There's no problem with switching off Webcil. The issue is that if the dev switches off Webcil, they get DLLs, and this section was about using PowerShell commands to change the file extensions from .dll to .bin. Using the commands that we were showing, which can be seen here ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly/?view=aspnetcore-7.0&tabs=windows#change-the-file-name-extension-of-dll-files

... break now. They used to work back in the 7.0 era. What I've done is just version that section out for 8.0 or later on the grounds that the vast majority of devs should be using Webcil.

Because this doesn't have anything to do with Webcil ... only commands in this article section ... we'd usually open the issue here on the docs repo. Do you want an issue here focused on updating the commands in the artcile, or do you really want one on the dotnet/runtime repo? ... or just stick with the direction that I took (i.e., version the section out at 8.0+).

@maraf
Copy link
Member

maraf commented Apr 14, 2025

@guardrex I'm sorry for misunderstanding you! I applied Saturday's quality of reading github comments where I needed Monday's.

@maraf
Copy link
Member

maraf commented Apr 14, 2025

@guardrex I read it all once again and my final question to confirm that I understand it is:

There isn't a problem disabling Webcil and changing the extension, but if Webcil is enabled, the extension for managed dlls must be .wasm, am I right?

@guardrex
Copy link
Collaborator Author

Not exactly. Let's break that into two scenarios for 8.0 or later ...

  • If Webcil is enabled (the default), the extensions are .wasm, and we don't anticipate that devs will need to change the .wasm extension to something else. We didn't provide guidance on changing .wasm extensions. We've been recommending that all devs use Webcil, and there are no PU or doc issues AFAICT of devs complaining about blocked .wasm files.

  • If Webcil is disabled, the managed DLL extensions are .dll, and this section was about how to change the .dll file extensions to .bin in order to possibly† avoid having the DLL files blocked. The section predates the use of Webcil, and that's why it was here. Prior to Webcil, some devs were having their DLL files blocked. Due to implementation changes for Blazor, the guidance that we've had on changing from .dll to .bin is broken, possibly broken since 8.0 ... but certainly broken for 10.0. What I've done is version out this section for 8.0 or later.

possibly: We told devs that merely changing extensions wouldn't work in many cases due to heuristic file scanning. We told devs that to avoid blocked DLLs that they should either upgrade their apps to 8.0 or later to use Webcil or use a custom deployment layout (.NET 6 or later).

The question is if we should have an issue to fix our guidance for 8.0 or later ... or 9.0 or 10.0, whenever it broke, I'd need to investigate further to see when it broke ... for changing dll extensions to .bin when Webcil is disabled, or should we just let devs let us know if that's a scenario that they're hitting before going to any trouble trying to fix this old guidance? Changing file extensions seems like a hack relative to upgrading and going with Webcil. I think that we could wait and see if anyone reports a problem.

@guardrex
Copy link
Collaborator Author

Just to clarify why I typed all that out 😄 .......

There isn't a problem disabling Webcil and changing the extension

Not exactly. We never had that guidance. We've always assumed that if the dev uses Webcil that they won't have a problem with blocked files, and there are no PU or doc issues of anyone having a problem with blocked .wasm files. This section is only focused on blocked DLL files, which is only a possible scenario in 8.0 or later when Webcil is disabled for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants