skip to Main Content

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.

2

Answers


  1. 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.

    Login or Signup to reply.
  2. @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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search