Sign in to follow this  
Binary1010

[web] Installing ASP.NET applications to a remote server

Recommended Posts

As far as I can tell, the Web Setup project in VS2005 (it's also in VS2003) is used for installing ASP.NET applications, rather than juts copying the files up to a web server. However, the Web Setup project always attempts to install the application on my PC; is there any way I can make it install to a remote web server?

Share this post


Link to post
Share on other sites
ASPNET applications do not really need "installing". That is one of the good things.

I just use a batch file to copy the relevant files to a staging directory (by file type, i.e. without .cs etc), then copy from there into the web server.

Mark

Share this post


Link to post
Share on other sites
I know they don't have to be installed, but I want to re-distribute my BBS, written in ASP.NET, without giving away the source code. Any way I can do this?
EDIT: And if Web Setup projects aren't for installing ASP.NET applications, what are they for?

Share this post


Link to post
Share on other sites
Web Setup projects are for complex installations. Basic ASP.NET applications do not really *need* them. XCopy deployment will suffice.

VS2k5 has a publish feature that allows you to deploy to a remote server over a variety of transport mediums including ftp. Be careful though. Whatever directory you publish to should only contain files that are in your solution explorer, any other files will be deleted. I noticed this when I published to my wwwroot directory =/

XCopy deployment will result in the same thing that a Web Setup project does. Your source files aren't meant to be placed on the target machine. You just place the aspx pages, config files, and the DLLs in the bin directory.

Ignoring the fact that my web server was deleted and I needed to restore my wwwroot directory, the publishing option is pretty cool :)

~Graham

Share this post


Link to post
Share on other sites
You don't need to deploy the source code to the production server. In fact I never do so. I use xcopy32 to copy various types of files into a staging directory.

I do this by filename extension, including .dll (assemblies built in vs.net) but excluding source code (.cs) files.

Mark

Share this post


Link to post
Share on other sites
So I have to give away my .aspx files no matter what? Most of the main code, it seems like, is in the .aspx file... my goal is to make a BBS available to the public written in ASP.NET while keeping as much source code hidden as possible.

Share this post


Link to post
Share on other sites
Quote:
Original post by Binary1010
So I have to give away my .aspx files no matter what? Most of the main code, it seems like, is in the .aspx file.

You should have used code-behind files.

Share this post


Link to post
Share on other sites
Quote:
Original post by igni ferroque
Quote:
Original post by Binary1010
So I have to give away my .aspx files no matter what? Most of the main code, it seems like, is in the .aspx file.

You should have used code-behind files.


Not exactly sure what code-behind is, but I'll look into it... but even then, wouldn't I still have to distribute every single file, thus making all source code available?
EDIT: OK, new question: Once ASP.NET files have been compiled, can they run without the .cs files?

Share this post


Link to post
Share on other sites
Quote:
Original post by Binary1010
OK, new question: Once ASP.NET files have been compiled, can they run without the .cs files?


The aspx and ascx files do not get compiled (or at least, not ahead of time).

What you do is you write a "Code Behind" class, which is a class which *is* compiled ahead of time. The ASPNET system then builds the aspx file into another class which extends that class.

When you do "build" in vs.net it takes all your codebehind files, and builds them into an assembly (called a .DLL file but not the same as a win32 DLL) which is placed in /bin. At runtime, ASPNET loads this.

You can also write any other classes you want to (for example, utilities etc) and the compiler will build them into the same assembly.

Normal practice dictates that there should be no logic, and typically very little code, in the aspx files themselves.

Mark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this