I'm upgrading a legacy ASP.NET application written in VB.NET and running on .NET 4.0 to .NET 4.8. I'm not familiar with the structure.
Note: I'm in an extremely controlled environment, and I'm not permitted to upgrade the project to a modern .NET SDK. That is, I'm only allowed to go to .NET Framework 4.8.
After I re-target to the project to .NET 4.8, how do I go about upgrading the dependencies?
Frow what I can tell, it looks like I'll need to update the assembly versions in each .aspx
file:
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
There is also a web.config
file, but the assembly references seem redundant:
<compilation debug="true" strict="false" explicit="true" targetFramework="4.7.2">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
<assemblies>
<add assembly="Microsoft.ReportViewer.ProcessingObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
...
</assemblies>
</compilation>
Note: the web.config
file for production targets .NET 4.0.
I deleted these assembly references in the web.config and it made no difference, at least to the build and start-up. Touching the assembly reference in an .aspx
file (e.g. setting a bogus assembly version) did make a difference, and caused the build to fail.
Am I missing something? Are those assembly references in web.config
required? Do I really need to update every assembly reference in every .aspx
file manually?
Aside, if I try to re-add an assembly in the 'References' tab of the 'Property Pages' I get an error:
The website is already referencing the assembly System.Web.Extensions
I don't see the assembly references in web.config
updated. It does work for an assembly that isn't imported in the .aspx
pages (like System.Web.Extensions.Design
).
Here's a glimpse of the solution folder.
Updated the .net version from web properties. Try build the application. Then you gotta resolve each files / modules seperately which includes breaking changes. As per my knowledge there are not alternatives or shortcut.
I have actually worked on a application where we migrated a .net 3 application to .net 4.8 written in vb, webforms. We actually had to resolve everything piece by piece.