The ScriptTagHelper
doesn't render the type
attribute of the <script>
tag when the target framework is .NET 9
#57664
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
Is there an existing issue for this?
Describe the bug
The
ScriptTagHelper
doesn't render thetype
attribute of the<script>
tag when the target framework is the .NET 9. This problem will happen in both MVC Views and Razor Pages.Expected Behavior
The
ScriptTagHelper
should render thetype
attribute of the<script>
tag, as well as the .NET 8 is doing.Steps To Reproduce
Step 1. Download and extract the zip file I attached below.
That zip file includes an ASPNET Core Razor Pages project that owns a default Razor Page (Index.cshtml) that includes the
<script>
tag with thetype="module"
attribute.Step 2. Run that project with the following command in a terminal console.
Step 3. Fetch the default document of that app with the following command in another terminal console.
Expected: I expected that I could see the output like the one below.
Actual: I could not see the
type
attribute in the document the app rendered.Appendix
This problem won't happen when the target framework is .NET 8, not .NET 9. (You can verify that behavior with the command
dotnet run -f net8.0 --urls http://localhost:5000/
)This problem also happens on MVC Views even if the target framework is .NET 9. (See also: 📦MvcApp1.zip)
Exceptions (if any)
There will be an error message in the web browser's developer console, like this:
.NET Version
9.0.100-preview.7.24407.12
Anything else?
No response
The text was updated successfully, but these errors were encountered: