With Visual Studio 2005, 2008, and 2010 you can debug Classic ASP by attaching the debugger to the w3wp.exe process. This is very buggy and crashes often in 2005 and 2008, but works well in 2010. The only problem is that, as far as I can tell, VS2010 does not support Classic ASP code highlighting or code completion. HTML looks fine, but any Classic ASP code is just plain black-on-white.
I can't add <%#Script="VBScript"%> to the top of each page because of the site architecture, and even after testing that - it doesn't do anything.
This whole issue is highly confusing because with Visual Studio 2010 Express, the aforementioned Classic ASP support comes out of the box (minus debugging).
I can get alternating HTML and VBScript highlighting by switching between the following modes (but never both). I have tried the following: Tools > Options > Text Editor > File Extensions > Adding an "ASP" extension with the following Editors:
Automatic Editor Selector (XML) - gets the HTML right, but no dice on
the ASP
Microsoft Visual Basic - gets the ASP mostly right (lots of
underlined errors even though code is up to ASP standard), but no
HTML highlighting
Script Editor - HTML but no ASP
Web Form Editor - HTML but no ASP
I have considered extending the Editor, my thoughts being to try and mix the markup for the Web Form Editor and the Microsoft Visual Basic editor, but am unsure if this is a reasonable course of action.
How can I get code highlighting and intellisense for Classic ASP in Visual Studio 2010?
Solved!
TL;dr: Install Service Pack 1
Walk you through the troubleshooting process:
Uninstalled VS2010 Ultimate completely on machine with problems
Installed VS2010 Professional as per comments. This did not solve the
issue. Same problems as before.
On a new computer with a fresh install of Windows 7 I installed VS2010 Professional.
This time it asked me to install Service Pack 1 after installing
(http://www.microsoft.com/download/en/confirmation.aspx?id=23691).
Went into the asp code and it was highlighting and code suggesting
perfectly. Debugging worked flawlessly as well.
Returned to original (faulty) computer and manually installed SP1 and the problem went
away.
Related
I'm new to Visual Basic. I have done some tutorials in Visual Studio 2010 and I am working with Visual Basic 6.0.
I don't know where I can write code the way I did in VB 2010. Instead of the code editor that was available in Visual Studio 2010, I get a UI editor, where I can add buttons. How can I simply write some Visual Basic code?
In VB6, there is a code view. If you double click the button it will take you to the click event in the code view for instance.
If you create modules.. (.bas file extension), you can write stand alone code. It's also possible to create an activex dll project to write code components. I used to do this, register them with com and then call them from ASP pages on NT4 servers back in the day.
VB6 predates the .NET framework though. It's much different than what you've learned in Visual Studio 2010. None of the .NET libraries are there and there are some syntax differences as VB.net is more strict than VB6 is.
You code use other editors alongside VB 6's editor like Notepad ++ and Sublime Text if you are really good in VB othersise just stick to it. Its very cool and people are making world class apps with vb6 check planetsourcecode.com you see wonders
I have pages in VS2010 (C#) which when I open the markup language (aspx), once in awhile the text can't be collapsed.
I frequently collapse by tags when I need to add new sections of markup.
Has anyone else experienced this? Does anyone know a solution?
Closing and reopening the page doesn't always work.
Switching to design mode and back doesn't seem to always work either.
[I am using the most recent service pack].
Just a VS2010 quirk? It does it to me sometimes too, and we're definitely not the only ones - Automatic outlining (collapsible sections) does not start for .ASPX files in Visual Studio 2010 SP1
I'm using visual studio 2008 for a classic asp application. Will I be able to upgrade to visual studio 2010?
Yes, classic ASP can be developed just fine in VS2010 as it does in VS2008 SP1.
I've found this msdn page
http://msdn.microsoft.com/en-us/library/ms241740.aspx
it says:
Although the primary focus of Web debugging in Visual Studio 2010 is ASP.NET, you can also debug legacy ASP Web applications.
ASP Web applications consist of scripts, which run on the client in .htm files and on the server in .asp files; the Global.asa file; and .cdf files. Scripts can be in VBScript, JScript, or a mix of VBScript and JScript. They may also be mixed with HTML code and COM objects. You can debug ASP Web applications containing all of these elements.
Right now I'm working on classic asp pages with visual studio 2008 an everything works fine, I can even debug classic asp...
Still couldn't try it with vs 2010, but the page above gives me some hope...
Usually you can manually deploy an asp web site direclty to the inetpub\wwwroot folder (just paste all of your required web page files to the wwwroot directory), where your default.asp page should reside at the root of wwwroot, if that makes any sense.
Then you can create an empty web site with a single project, start your web site by entering http:\localhost in to a new browser window, and you should see your default page displayed.
You can add all of the extermely old asp files to your new fangeled visual studio 2010 application directly from the wwwroot directory.
You should be able to compile your application but you won't be able to debug it at this point.
To debug the ancient application, simply attach to the internet explorer process with the title of your outdated web application (or the wp3p process....), and you will then have debugging functionality.
Or, you can wait for the old yet useful app to throw an error and then use visual studio 2010 as the J.I.T.debugger.
Hope this helps as well.
Happy coding! (if that is possible in classic asp, thank GOD for visual studio)
(-:
To get VS2010 to support .inc files as well as .asp files, see the related question Can Visual Studio 2010 do ".inc" file syntax highlighting?
VS2010 syntax highlighting for .inc files isn't very good even with the Web Form Editor in use; the HTML shows up fine but the VBScript looks like plain text.
I updated my project from VS2008 to VS2010 and everything has been going alright.
In order to get debugging to work with javascript in a script block I have to add a debugger; statement to get it to break. If you have the javascript in a seperate file you can debug with just a break point. The Classic asp will still debug if I attach to the w3wp process.
The javascript intellisense has been working better for me in VS2010 than in VS2008. In VS2008 I had issues with it crashing when I stopped debugging classic ASP. In VS2010 I don't have that problem any more.
Overall I'd say VS2010 does classic ASP development better than VS2008.
For anyone who wants Syntax Highlighting in VS 2010 and can't get it working. I think this works.
Tools>Options>TextEditor>FileExtension
Add the extension ASP and it should be attached to "HTML Editor with Encoding".
A few times a day my VS2008 SP1 freezes if I edit XAML code. It just got stuck and I have to kill the process.
It seems to be a problem with the IntelliSense or the spell-checking or whatever process is going on while I edit code.
The problem is very apparent if I copy+paste some code. Even if it is just one word. Many times VS2008 adds some additional commands in the code and messes things up completely.
This never happened with C# code only with XAML it does get stuck.
One more thing: It seems the problem only occurs when I edit control templates. I added a few control templates from the MSDN pages to my project. When I edit them - even doing simple things like changing brush colors - Visual Studio freezes (sometimes). So it seems it's not a general XAML problem it happens with control templates only.
You could try this update: Installing DExplorer after VS 2008 breaks xaml intellisense
EDIT: You could try closing the Properties window when editing XAML, it helped me before with ASP.NET.
Some other links:
Xaml Editor Crashes after Visual Studio 2008 SP1
Using the Source Code Editor for XAML in Visual Studio
After having this problem and hunting around on the interwebs I found this vsnet-crashes-when-editing-xaml
Which said, in summary, if you edit a xaml resource while something that uses said resource is open in a designer, then you'll be sorry.
So you can avoid the problem by
Closing the other designer windows;
Installing hotfix KB958017.
I've been stuck with visual studio 2003 for ages because of my need to debug asp classic code...
A few years ago I tried to debug classic asp with vs 2005 with no luck, I think there was some dirty hack that was supposed to achieve that "magic", but I couldn't make it work...
I wonder if anybody has been luckier than me...
Haven't tried yet with vs 2008, but I'm not very confident on that, due to the lack of support to classic asp from microsoft...
--
edit:
oops!, just found the following question
Does Visual Studio 2008 support classic ASP development?
so it seems like visual studio 2008 really supports classic asp debugging...
I'll leave the question open for a couple of days, just in case someones wants to add some tutorial, comment or anything interesting...
--
edit:
some links
the dirty visual studio 2005 hack I was talking about:
http://blogs.msdn.com/greggm/archive/2006/03/15/552108.aspx
a few links explaining how to debug classic asp with visual studio 2008, couldn't try any of them yet...
http://www.codeproject.com/KB/debug/DebugVBScriptVS2008.aspx
http://codepagoda.com/2009/04/30/debugging-classic-asp-with-visual-studio-2008-sp1-and-35-framework/
http://bytes.com/groups/asp/836751-better-debugging-classic-asp-visual-studio-2008-sp1
I have debugged Classic ASP in Visual Studio 2005. Also, Visual Studio 2008 was supposed to make it better, but I never had a chance to try or to find out the details.
Your biggest problem is that Visual Studio 2005 took away the ability to "Start With Debug" an ASP application.
In VS 2005, Microsoft completely changed the way the debugger connected to IIS. The old way (for both ASP and ASP.NET) which was used by everything from InterDev (remember InterDev?) through VS 2003 was orchestrated via the "Machine Debug Manager", a sort of intermediary helper service. The whole thing was... arcane, trying to solve a complex problem that was made harder by the fact that IIS and Visual Studio run under separate accounts and in some cases, different machines. This was a very delicate process that was very prone to break at the slightest configuration change.
Every single one of my machines stopped being able to debug Classic ASP at some point or another for reasons that appeared related to the alignment of the stars. I used to have at hand a 14 page checklist printout that described the whole "incantation", jumping from IIS Manager to Visual Studio to User Account Manager, to COM+ Explorer... and even that didn't always work. It makes me shiver just thinking about it.
Ultimately, they gave up. In Visual Studio 2005, Microsoft came up with a different architecture for debugging IIS applications (sorry; I don't know how it works now). At the time, MS decided that not enough people were using ASP anymore, and prioritized other work on top of it. Enabling ASP debugging through the new architecture was a significant amount of work especially for a technology on its way out, so it got chopped. I don't blame them; they made a sound business decision. Would you rather have no ASP debugging in VS 2005? Or yes ASP debugging on VS "2006"?
Anyway, not all is lost.
First, you can't "launch" the debugger with F5 anymore, but you can still attach manually to an already running ASP process and it will work, as long as you enable debugging in IIS Manager by hand. The experience in Visual Studio 2005 is sometimes better, sometimes worse than under older versions. It's certainly more stable and very much doable. More details below.
Second, I heard at some point that Visual Studio 2008 was supposed to make a come back and get ASP debugging back in the product, or at least bring some improvement, or some such -- I could never quite get a clear picture. Then I lost track of the whole thing because by some miracle I've kept myself out of dealing much with ASP projects for a few years now.
I'll try to find more references on VS 2008 and classic ASP. If I find something, I'll edit this post with it (sorry -- it might take me a few days to get to it).
More details can be found in these posts:
Full instructions on how to debug by manual attaching in this Gregg Miskelly post: Debugging Classic ASP Code
Other related information can be found here and at other Mikhail Arkhipov posts.
Hope this helps.