How do I compile an ASP.NET page without Visual Studio?

N

needin4mation

I work in Visual Studio, but not everyone where I am at does.
Sometimes, however, they may have to make minor adjustments here and
there. Since the code is c#, behindform code, if they make an
adjustment to the .cs source, how can they compile it so they will see
the changes on the web server and thus not require Visual Studio?
Thank you.
 
G

Guest

Yes. There are a couple of ways of handling this.

1. If you NEVER edit in VS, consider changing the CodeBehind="" to src="".
This makes each page a "compile on the fly" type of page.

2. If not, you can create a batch file to build you site. The compile step
is something like:

ECHO "Setting up the path to be able to run csc.exe"
SET path=%PATH%;%WINDIR%\Microsoft.NET\Framework\v1.1.4322

ECHO "COMPILING THE SITE"
csc.exe /out:bin/CSharpWebTest.dll /target:library default.aspx.cs
global.asax.cs

This assumes only two compileable files in the site, however.

3. Another option, for ASP.NET 2.0 is the creation of an MSBuild script.

4. You can also use nAnt to build your site after changes.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
N

needin4mation

Thanks. I edit it VS, but they don't. They might have to to something
in an emergency, however.
 
J

Juan T. Llibre

If you mean *editing* an ASP.NET page, sure, you can
use the Web Matrix...if you only work with 1.1 objects.

The Web Matrix does not compile source code and doesn't support 2.0 objects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top