MVC Applications break after Windows update of Oct 15

前端 未结 2 1877
灰色年华
灰色年华 2021-01-04 19:27

This morning I woke up discovering that my MVC 4 web application on my server had broken.

The error message is:

An exception of type \'System.IO.Fil         


        
相关标签:
2条回答
  • 2021-01-04 20:27

    You need to install Newtonsoft.Json 5.0.1 nupkg. BTW, what file version of System.Web.Http.dll do you use in your project?

    0 讨论(0)
  • 2021-01-04 20:30

    Thanks all for your good thoughts! I had tried to do the assembly redirect, but it didn't work.

    I eventually fixed the problem in a very simple way. I suddenly realized I never used the route below:

    routes.MapHttpRoute( 
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );
    

    So I deleted these lines and presto, all worked again!

    Some research showed me the MapHttpRoute is part of the older version of the System.Web.Mvc.dll, but not of the newer version. So the new dll is incompatible with the older version.

    It still bothers me that a running, production web application breaks while I am sleeping by a Windows update. Turning off Windows updates could be a solution, but makes the server more vulnerable... what is wisdom here.

    Thanks again everyone.

    0 讨论(0)
提交回复
热议问题