Debugging VB code in aspx files - asp.net

I am converting an old asp project to a new .NET project. Now, all vb code are inside aspx files, and we are on the process of moving all vb script from aspx files to .vb files. My problem is, I can't debug the vb script inside most of the aspx files. All my friends don't have this problem. I think the problem is with vb text editor.
I am using Visual Studio 2008.
Is there anyway, I can make visual studio understand that aspx files have vb script inside them.
can't debug the code
can debug the code

You can set a breakpoint on a particular line in the VB Script. If that line is hit you will see Visual Studio highlight that line.

You can use the Visual Studio Debugger to debug a .vbs (vbscript) file executed with cScript.exe by using the //X flag at the command line. To debug MyTest.vbs
cscript.exe MyTest.vbs //X
The //X will set a breakpoint and invoke the "select a debugger" dialog where you can choose Visual Studio and step into your vbs code.

Related

Cannot use breakpoint's to debug VB.NET

I am working on a project that is build with VB.NET
VS2012 web edition .net Framwork 4.5
The previous developer had build this project without using any debugging features, yet i wish to do so,
I have managed to use the debug option, yet the breakpoints are giving me the
"No symbols have been loaded for this document"
The code is written as a "web site" - no solution file, all the aspx files are related to the VB using "codefile=" and not "codebehind" therefore there is no DLL to debug,
What can i do ?

ASP.NET MVC - compiler not updating global.asax

I was trying to make some changes to my global.asax.cs file, when I spotted, that after publishing my mvc application that file is not even touched by visual studio. Last modified date is from last week, while today I made a lot of changes to it. How do I force visual studio to actually do something useful?
Make sure that the "Build Action" for the Global.asax is set to "Content". Open Visual Studio -> Right Click on Global.asax -> Build Action

Create classic asp project in Visual Studio 2010 from scratch

I have always developed on ASP.NET on 2.0 and higher .NET framework.
I am trying to create a website in classic ASP from scratch using VS2010 and can't figure out how to do that.
Thanks
Create a new folder
Open Visual Studio
Choose "File" -> "Open web site"
Go to the recently created folder
Then right click -> Add New item
Select "HTML File"
Rename the file as .ASP
Create a new web site or virtual directory in IIS and point to the folder
Profit!
(alternatively to 8, you can use the new IIS Express that supports ASP Classic)
As you probably know, classic asp has nothing to do with .NET. There is no type of project in VS 2010 (or any Visual Studion .NET) for classic asp sites. If you want to use VS2010 you can simply create text file with the extension .asp and start typing away.
You can use any text editor for the job. My favorites are primal script (greatest intellisense I have found for classic asp) and Notepad++
You donĀ“t have to compile anything since asp is scripting language and will be interpreted each time.
So just start creating text files with asp endings and fire away.
If you want to use something for classic ASP from/supported by Microsoft then you should consider Web Matrix which includes IIS Express and is a free download.
It does require ASP.net 4.0 if not already installed.

Compiling the whole asp.net website on Mono at once

i am compiling the asp.net web application page by page using "gmcs" command in Mono.
But i want to compile the whole asp.net website at once using Mono command.
For ex:
gmcs /t:library /out:bin/AJAX.dll -r:System.dll -r:System.Web.dll -r:bin/AjaxControlToolkit.dll Default.aspx.cs Default.aspx.designer.cs
I do not want to do like the above one, instead i want to compile the whole folder containing files at once.
Plz let me know.thanks in advance
I used to run xbuild on projects created using Visual Studio as IDE. Worked perfectly! I'm not sure if MonoDevelop generates a .csproj file for your web application but that's the best way to compile ASP.NET, which, however, was supposed to be compiled automatically by xsp on the first request

CodeFile vs CodeBehind

What is the difference between CodeFile="file.ascx.cs" and CodeBehind="file.ascx.cs" in the declaration of a ASP.NET user control?
Is one newer or recommended? Or do they have specific usage?
CodeBehind: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is placed in the bin folder of the website. You need to do a compile in Visual Studio before you deploy. It's a good model when you don't want the source code to be viewable as plain text. For example when delivering to a customer to whom you don't have an obligation to provide code.
CodeFile: You provide the source file with the solution for deployment. ASP.NET 2.0 runtime compiles the code when needed. The compiled files are at Microsoft.NET[.NET version]\Temporary ASP.NET Files.
I'm working with an Application Project in Visual Studio Express 2012 For Web and using .NET 4.0. In the code behind files for my login and change password pages I found a situation where I needed both CodeBehind and CodeFile in the declaration.
If I don't add a code file reference like
CodeFile=login.aspx.cs
The web page doesn't parse and the browser displays a parser error. It doesn't matter whether I compile the project or not.
If I don't add a code behind reference like
CodeBehind=login.aspx.cs
References to Security classes like MembershipUser fail both at compile time and when attempting to use intellisense with an error like "The type or namespace MembershipUser cannot be found". I have added a reference to System.Web.ApplicationServices as required by the .Net 4.0 framework.
I should add that these troublesome files are running in an application within the website created using the IIS Application tool. When I open the website from Visual Studio I have no difficulty with parser errors or reference errors. This confusion only occurs when I open the application as a project in Visual Studio.
Codebehind file need to compile before run but in src we dont need to compile and then run.. just save the file.

Resources