Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Made a website in ASP.NET 4.0, my web host is on ASP.NET 2.0

Tags:

asp.net

I developed a website using Microsoft Visual Web Developer 2010. I'm not a serious programmer, but I can get by if the software is user-friendly enough. Anyway, I have come to learn that the website I developed was on ASP.NET 4.0 -- I think it might be 4.0.30319, as I look in my computer-->c:/-->windows-->microsoft.net-->framework.

Anyway, the webhosting company I'm with has ASP.NET 2.0 installed on their servers. Consequently, when I uploaded my site, I get a runtime error, telling me that my web.config is wrong, or whatever. But I'm positive that it's because my website is in 4.0, and their servers are on 2.0.

Well, this is a company website, so it needs to get up ASAP. I know I could switch hosts and all that, but does anybody know of an easier fix? I tried deleting the web.config and the site loaded, but it was all screwed up. The site works fine in my localhost.

So the long and short of it -- is there anything I can do to make my site work on a server that has only the ASP.NET 2.0 framework?

like image 271
Jason Weber Avatar asked Dec 07 '25 03:12

Jason Weber


2 Answers

In short; no. It would probably be faster for you to get a new host than try to backport your site to 2.0, unless it is extremely simple. But 4.0 code won't run on a 2.0 site.

like image 63
Andrew Barber Avatar answered Dec 08 '25 17:12

Andrew Barber


If you don't want to change hosting company, the only way is to 'downgrade' your site to .NET 2.0: Right click on your project -> properties -> build -> target framework

PS

this will probably involve a (big) amount of changes to your code.

like image 45
mamoo Avatar answered Dec 08 '25 18:12

mamoo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!