Made a website in ASP.NET 4.0, my web host is on ASP.NET 2.0 - 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?

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.

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.

You either need to change the framework of the site or upgrade your host.
What you're asking is "how do I get an application that requires Windows 7 to run on Windows 98?"
You may be able to push the DLLs to the site (specifying they are content files and the site can then include them) but this isn't easy by any means (nor is it 100% fool-proof).

Related

References to .NET assemblies on server 2008

I've recently just attempted to deploy a site (it's a web api project) I worked on a Win 2K8 server with IIS installed and the .NET 4.5 framework installed. i was surprised when it didn't work. It basically acted as if it had never heard of the MVC-style routing notion; because it was issuing a controller/action/id type request it didn't know to invoke the routing engine and map this to controller actions.
I eventually took the fairly extreme and silly approach of setting copylocal = true for all assemblies in the project, even the ones that I know must be in the GAC. Bin-deploying it this way works.
So....my question is this - how do I know which need to be copied local and which don't? I mean, I installed the .NET framework 4.5 on the server, and ultimately it seems as if the libraries involved should have been resolved because the .NET framework was installed? Of course the nuget packages all need to be copylocal=true, but within the set of MS standard libraries it seems as if the web site still doesn't find all of them.
Is there a rule I can follow that helps me understand which ones I need to copy locally?
If ASP.NET MVC 4 is the first version you use, and you don't learn every aspects of the framework from a good enough book, I hope you spend some time to review related articles on the Internet to get better understanding,
http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx
http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx/
ASP.NET MVC is not bundled in .NET Framework, so most of the binaries you refer to must be set as copylocal=true. This must be painful for beginners, but experienced users are already familiar with that.

asp:Menu Not working on webhost

I'm using Visual Studio Web Express 2008 to develop an ASP.Net website. I have a master page that every page inherits from and on that master page I have the asp:menu control. On my local machine the menu control works just fine. The javascript is emitted and the links work as well.
However, when I upload it to my webhost service provider, the javascript is not emitted and my links do not work. I'm getting a feeling that my service provider really doesn't know much about .Net as they suggested that I make sure that I upload the .js files which isn't necessary.
Does anyone have any suggestions that I can give them? They're asking me what requirements are needed. It seems to me that something is not setup on their server properly but according to them, they have .Net 3.5 SP1 installed.
Everything for the control should be in the framework (no extra steps necessary); make sure in IIS they set it up to use the 2.0 version of the framework (which is probably the case)...
The cases of errors where I've seen that is when the framework isn't installed.
there is an http debugging tool called fiddler that will help you to see what is going wrong with the menu and related site resources. See the requests those are returing 404 and it will help you a lot to head towards the solution faster

Standalone ASP.NET development server

I remember seeing a page on codeproject.com where a developer took one or two .dlls from Visual Studio Web Developer 2008 and created a simple win32 form application for hosting a standalone development server.
It was a small applicaton that allowed you to enter the path, port number, and a "GO" button, and it launched the server standalone, without having Visual Studio installed.
I am looking for that solution but can't seem to find it. I am also aware of the Cassini project, the extended version of it, and a webdev.exe (or something like that) solution, but not the dll + form app.
Thanks in advance.
-- Martin
I don't know what happened to the code project article you mentioned. However the framework has the ability to host and run asp.net web applications. Rick Strahl has a nice article on hosting asp.net webpages within a winform app Using the ASP.Net Runtime
There is also an older article on the cassini server on MSDN
It should be simple enough to do what you want with those articles as a starting off point.

ASP.Net portable server

I'm trying to start on a new project to help enrich my asp.net knowledge, since I'm not completely satisfied with what my class is teaching me. From my (very little) experience with Rails, I recall every application containing its own development web server. Say I were trying to create a local-only application, but I want it to run in a web browser (Therefore ASP.Net). Are there any options in terms of being able to distribute an application and have it launch its own, or just not require IIS/VS/Apache-mono?
You may want to look into aspNETserve. It sounds like it would fit your needs. I haven't worked on it recently, so it probably has some rough edges.
On the plus side its all open source, and if you are just getting started with ASP.NET it would be a real eye opener on how the internals of the ASP.NET lifecycle operate.
The simple answer is that you need a web server to run the application. It cannot run without one.
If we're talking demo purposes or you don't require that many features of a web server there are redistributable web-servers that you can include with your setup package.
Like Alex mentioned the most popular one seems to be Cassini.
I'm assuming that you want to run the site on the same machine you are developing it on.
Visual Studio 2005 and up allows you to run the site from VS itself if you want to view it locally on your development machine.
To my understanding Visual Web Developer allows you to do the same as well.
Visual Web Developer
You can use the cassini web server. Please note that those are different redistributable:
http://www.asp.net/Downloads/archived/cassini/
http://ultidev.com/products/Cassini/
I'm not really certain why you would want to develop a web application (with all the difficulties it entails, due to the fact that you are dealing with a stateless connection to an unknown client machine), but then run the entire thing on the client machine.
Surely it makes more sense to develop a WinForms application?
Follow this guide to setup IIS on your PC to run ASP.NET apps:
http://www.geekpedia.com/tutorial25_Setting-up-your-ASPNET-server-IIS.html

Debug .asp pages with visual studio 2005

I'm migrating a website made in classic asp to asp.net, but the asp.net dev server doesn't handle .asp pages.
Is it possible to make it run .asp pages? Maybe a custom httphandler for .asp?
thanks!
Are you running Winxp with IIS installed? If so, here's what I do: hit the asp pages in the browser using your local IIS, and then open the folder where the ASP pages reside as a website project in VS. Go to the Debug menu, choose Attach to Process, and then look for the dllhost.exe process that is running under the IWAM_MACHINENAME user. You also have to make sure the you have setup the virtual directory to allow ASP server-side debugging. After attaching to that process, you can set breakpoints, etc. as usual.
The last time I had to debug asp pages I found it was easier to insert a bunch of Response.Write()'s. If you cant find a way to do it in VS, then this may help.
Unfortunately you will have to use traditional (or arcane!) methods to debug your asp pages in VS2005 (i.e. alert(), response.write() etc.)
Possibly not what you want to hear, but vs2005 doesn't support this. It was re-added into vs2008. Perhaps one of the free vs2008 express edtions might get you out of this hole?
In addition to the answer provided by patmortech I would recommend that if you are testing a mixed tech site you attach to aspnet_wp to debug the .NET portions of the app. This is also true if your app uses third-party ISAPI filters.
The Cassini server is good for pure .NET only.

Resources