Background - About 10 years ago a co-worker and I wrote a web application in VB.NET / ASP.NET 3.5 web forms. Once this application was released, my role in the organization changed to more of a Systems Administrator - I haven't written any ASP.net since.
The co-worker went through a similar transition and is now head of a non-IT department. While he still tinkers with this application, it still sits in .net 3.5.
I am looking for assistance in getting this "upgraded" to support .net 4.5.1 - mostly because of another project, I would like to add some functionality to the application to use some external REST API calls. It seems like the way this is done these days
is with
System.Http.HttpUtility.HttpClient
So I went through all of the different class libraries in this solution, changed the target framework to 4.5.1 - they all built successfully. I did the same for the website project, again, it built successfully.
The application uses Forms Authentication against our internal active directory. This functions fine when I run the application from VS on my machine (v3.5). Once I flip things to v4.5.1, authentication succeeds, but each page I try to load, I am redirected
to the login.aspx page!??
I don't really know what to look at, being so far removed from this stuff. Did some google searching - found that the machine key in the web.config file should be set to SHA1 - as that was a breaking change after 3.5. Made this change, still have the problem.
Also found a Scott Hanselman post regarding breaking changes. I added
<httpRuntime requestValidationMode="2.0" />
to the web.config. Still have the problem.
The app runs locally on my machine, in IIS Express. I am not sure if that is part of the problem - IIS Express?? I am looking for any direction
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
According to your codes,I suggest you could open failure request tracking to check what's the detail error.
Best regards,
Yijing Sun
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
14 Points
92 Posts
Moving Solution from .NET 3.5 to 4.5.1
Feb 15, 2021 01:35 AM|stephenmbell|LINK
Hello all,
Background - About 10 years ago a co-worker and I wrote a web application in VB.NET / ASP.NET 3.5 web forms. Once this application was released, my role in the organization changed to more of a Systems Administrator - I haven't written any ASP.net since. The co-worker went through a similar transition and is now head of a non-IT department. While he still tinkers with this application, it still sits in .net 3.5.
I am looking for assistance in getting this "upgraded" to support .net 4.5.1 - mostly because of another project, I would like to add some functionality to the application to use some external REST API calls. It seems like the way this is done these days is with
So I went through all of the different class libraries in this solution, changed the target framework to 4.5.1 - they all built successfully. I did the same for the website project, again, it built successfully.
The application uses Forms Authentication against our internal active directory. This functions fine when I run the application from VS on my machine (v3.5). Once I flip things to v4.5.1, authentication succeeds, but each page I try to load, I am redirected to the login.aspx page!??
I don't really know what to look at, being so far removed from this stuff. Did some google searching - found that the machine key in the web.config file should be set to SHA1 - as that was a breaking change after 3.5. Made this change, still have the problem. Also found a Scott Hanselman post regarding breaking changes. I added
to the web.config. Still have the problem.
The app runs locally on my machine, in IIS Express. I am not sure if that is part of the problem - IIS Express?? I am looking for any direction
Thanks
Steve
Contributor
3730 Points
1431 Posts
Re: Moving Solution from .NET 3.5 to 4.5.1
Feb 16, 2021 06:32 AM|yij sun|LINK
Hi stephenmbell,
According to your description,could you post your web.config to us?You need to check your authorization , targetFramework or others.
Or are you sharing between applications?
In your .net 4.5 application's web.config, set the compatibility mode attribute:
More details,you could refer to below article:
https://stackoverflow.com/questions/12021863/upgrading-to-asp-net-4-5-mvc-4-forms-authentication-fails/12061090#12061090
Best regards,
Yijing Sun
Member
14 Points
92 Posts
Re: Moving Solution from .NET 3.5 to 4.5.1
Feb 16, 2021 04:56 PM|stephenmbell|LINK
Here's the web.config. I've redacted a few pieces of sensitive information.
Thanks
Steve
Contributor
3730 Points
1431 Posts
Re: Moving Solution from .NET 3.5 to 4.5.1
Feb 19, 2021 07:29 AM|yij sun|LINK
Hi stephenmbell,
According to your codes,I suggest you could open failure request tracking to check what's the detail error.
Best regards,
Yijing Sun