0

Summary

I am maintaining a ASP.NET Web Forms 4.0 VB.NET project at my company

image from project's web.config enter image description here

Because of Improper Handling of Exceptional Conditions in Newtonsoft.Json

I need to upgrade the version of Json.NET to 13.0.1 about
ASP.NET Web Forms 4.0 VB.NET project

the JsonNet version in Web Forms project's Bin folder is .NET2.0 & 8.0.3.(the project I am maintaining)

I found that you can replace the Newtonsoft.Json.dll with new dll(.NET4.0 & 13.0.1) straightly on the old Web Forms 4.0 project on IIS server. And the original version is .NET2.0 & 8.0.3.

No error result, the porject runs well

I feel the two version are compatible

My problem is why web forms 4.0 can use a NET2.0 dll?


Other

this is what I had dowmloaded from Json.Net github source code. And this is the all .NET version of the 13.0.1 version Json.NET
tree structure
tree map

HsuTingHuan
  • 615
  • 1
  • 7
  • 23
  • 1
    I think it's .NET 4, see [Cleaner HTML Markup with ASP.NET 4 Web Forms - Client IDs (VS 2010 and .NET 4.0 Series)](https://weblogs.asp.net/scottgu/cleaner-html-markup-with-asp-net-4-web-forms-client-ids-vs-2010-and-net-4-0-series) and [What’s New in ASP.NET 4.0, Part One: Core Engine Features](https://www.codemag.com/article/100133/What%E2%80%99s-New-in-ASP.NET-4.0-Part-One-Core-Engine-Features) – dbc Aug 23 '22 at 06:30
  • You can also check the .NET runtime your app is using programmatically as shown in [Is there an easy way to check the .NET Framework version?](https://stackoverflow.com/q/951856). Based on that you can choose the correct Json.NET DLL. – dbc Aug 23 '22 at 06:33
  • @dbc I was confused lol. After figure out the project's target framework that is 4.0, I think that should use the net40 version – HsuTingHuan Aug 23 '22 at 07:19

1 Answers1

-1

.NET framework are version compatibility

So .Net framework 2.0 library should work fine on .Net framework 4.0

Also can see Side-by-Side Execution in the .NET Framework


some basic of Web Forms

According to What is Web Forms

ASP.NET Web Forms are:

  • Based on Microsoft ASP.NET technology, in which code that runs on the server dynamically generates Web page output to the browser or client device.
  • Compatible with any browser or mobile device. An ASP.NET Web page automatically renders the correct browser-compliant HTML for features such as styles, layout, and so on.
  • Compatible with any language supported by the .NET common language runtime, such as Microsoft Visual Basic and Microsoft Visual C#.
  • Built on the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance.
  • Flexible because you can add user-created and third party controls to them.
HsuTingHuan
  • 615
  • 1
  • 7
  • 23