Home > Software engineering >  To Change the Jquery version of a ASP.NET App
To Change the Jquery version of a ASP.NET App

Time:06-22

Currently I need to change the jquery version from 2 to 3 of an ASP.NET that is running on an IIS Server.

A vulnerability scanned our server and it created a incident to solve.

I found the file "<IIS_Directory>/Views/Index.cshtml" that has the Javascript references.

@Scripts.Render("~/scripts/vendor")

When I access from a browser I get several scripts instead of ' @Scripts.Render("~/scripts/vendor")'

How do I change the result of the '@Scripts.Render("~/scripts/vendor")' in a production environment?

Constraints I Only have the publish folder. At the moment I don't have the code source. until I have the code source I have to apply a patch.

CodePudding user response:

I think you can't do this without source code. The JQuery library is imported into the BundleConfig. I think it may be a solution, although not optimal, replace under Scripts JQuery's files with same file of version 3 and give it the same names.

CodePudding user response:

@Scripts.Render("~/scripts/vendor")

Is used to render a script tag (you said there was more than 1 so the bundler must be in debug mode) but the configuration of that bundle will be done in .NET code so you cannot realistically change that without the source code.

Perhaps you could update the actual jQuery source files (using the same file name) on the server and you may get lucky that nothing being used by the other scripts uses anything that has been removed in the move to version 3.

The only way to do it properly and not risk breaking the site is to do it in a proper development environment with the full source code and a proper regression test of all of the sites features.

  • Related