Debug .asp pages with visual studio 2005 - asp.net

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.

Related

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

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).

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

Detecting Changes in an ASP.NET Web Site

The ASP.NET framework does a very good job of detecting when a file has changed and recompiling that file etc. I would like to be able to hook into that update process. Is this at all possible?
I might want to do this as part of an initiative to try and version web sites developed as Web Site projects, versus Web Applications, where the version is easily found in statically deployed assemblies. If I my be misdirecting my energies as there are already better way if versioning web sites, I'd still appreciate some pointers.
I don't know if you can hook into that logic at all - perhaps you could add your code to Application_OnStart as this method will fire when ASP.NET recycles the AppPool and restarts the website.
Have you tried Web Deployment projects?
Scott Gu has a blog post.
You can use ASP.NET SignalR to do it, It's real-time web for .NET
Have you tried developing a separate module for ASP.NET that keeps track of last change?
This might put you on the right path (might -- I haven't tried this).
http://www.codersource.net/csharp_iis_metabase.html (dead link)

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.

Why is global.asax missing from a Website Project

A couple of questions regarding the role of global.asax:
Why is it not included in the Website Project in Visual Studio? Are there other ways of achieving the same functionality without this file?
If I would create a Web Application project, as far as I remember, a global.asax file would be created. If I were to delete it, would the project run?
I tried to look for some explanation regarding the global.asax compilation but didn't find any info about this.. would appreciate help/links. :)
Thanks!
An ASP.NET site can run without the global.asax file. Here is a question which talks about alternatives of global.asax file.
Even if you delete a global.asax file your site will work.
Globax.asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).
You can add Global.asax to the website project and it will work fine.
Global.asax is not added by default for web applications. If you have it, you can delete it without problems.
Be careful to include the .compiled files when deploying the website or else the events in Global.asax will not fire.
It sounds like you are familiar with Web Application Projects, now see a Web Site "project" and wonder what's going on. In any case, I'll answer as though that were true. ;-)
In Visual Studio 2005, Microsoft introduced Web Site "projects", which are not projects - they're just directory structures on a local disk, FTP site, etc. They do many things differently from Web Application Projects, and can therefore be confusing (especially if you're like me, trying to answer people's questions, not knowing which they are using).
With Visual Studio 2005 SP1, they restored Web Application Projects. If that's what you're more familiar with, then I suggest you use them. They're real projects, just like they always were.
And, BTW, there will be a global.asax, just like there used to be...

Resources