"Onclick" JavaScript invocations no longer working after upgrade to .NET 8.0 from .NET 7.0
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version] Dear Friends, After upgrade of an ASP.NET Core MVC application from .NET 7.0 to .NET 8.0, JavaScript invocations with "onclick" in Razor views no longer work. Is this behavior intended? If so, could you please refer me to an explanation in the documentation? Thank you in advance for your trouble, With best regards, Eric Weinberger
Original Comments
Feedback Bot on 2/25/2024, 11:46 PM:
(private comment, text removed)
Original Solutions
(no solutions)
Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
See our Issue Management Policies for more information.
My apologies for taking so long to respond to the request for more information. The problem seems to be due to the use of "asp-append-version" in references to JavaScript files in the wwwroot folder. Contrary to some comments that others have posted in various places, this problem affects not only development, but also production. It affects other wwwroot files too, such as style sheets. It would be great if the functionality of "asp-append-version" could be restored. Until then I will be stuck with .NET 7. Thank you in advance for your trouble.