Deploying ASP.NET projects

  • Thread starter Thread starter Gerben van Loon
  • Start date Start date
G

Gerben van Loon

Hi there, hope someone can help me on this:

I'm planning to deploy several ASP.NET projects to a production server.
Normally I used the "Project / Copy project" option in VS.NET, but to this
production server I only have FTP access. I tried copying the files with a
FTP tool, but it seems that every application needs to have an own virtual
directory, is this true? Or is it possible to just make 1 virtual directory
and put al the projects in there?

So is there a possibility to deploy with ftp access only, or do I need to
ask the system administrator to set up frontpage server extensions?

Greets,

Gerben.
 
Let me see if I can help you to understand these entities better. An ASP.Net
web application is an executable application. Therefore, it must run under
some process. This process is defined by the web server configuration of an
"application". Because it is a .Net application, directly under the root
folder of the web server application, there must be a bin folder where the
DLLs can be located. Location is almost everything in .Net. The web.config
file containing the "Machine to application" settings for the app must
reside in the root folder of the application. The various ASPX pages and
other files can be located anywhere at or under the root folder of the
application. However, this has nothing whatsoever to do with FrontPage
server extensions. Those are used by Visual Studio.Net for working with the
web server, getting documents, setting up a Web Application, etc. They are
completely unnecessary at run-time.

It is therefore possible to FTP your files to the web server, or to put them
where they belong in any way you like. Setting up the web application in IIS
is something which must be done by the network admin of the web server.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi Gerben,

You are nearly 100% correct, and in fact, I may just be misunderstanding
your last remark, and you may be 100% correct. It is certainly possible to
deploy ASP.Net projects using only FTP, as long as the web site is already
configured as an application.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi Kevin,

First of all thanks for your reply. I'm not understanding you 100%, but
let's see if I'm right:

- An ASP.NET project is an application and not just a couple of webpages. By
making a virtual directory for a project IIS knows that hat virtual
directory is an application. So every project needs an own virtual directory
to run, you cannot have multiple projects in 1 virtual directory since every
virtual directory represents an application.

- Frontpage server extensions can automaticly create a virtual directory on
a remote server so that a ASP.NET can directly be run.

So this would conclude that when you only have FTP access to a webserver it
isn't posible the deploy ASP.NET projects?

greets,

Gerben.
 
Hi again kevin,

Yeah ok, when the virtual directory is already setup it is posible to deploy
with FTP. I will ask the server administrator to setup frontpage server
extensions then. I suppose creating virtual directory's isn't an exciting
task for a server administrator :). Kinda unhandy deploying asp.net compared
to asp where you could just drop the files anywhere you want.

Thanks again for your help Kevin.

Greets,

Gerben.
 
Actually, Gerben, ASP required an IIS Application as well, and "execute
scripts" permission.. ;-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
hmm....?

But I never made a virtual directory for an asp application. Just made a new
map in the inetpub/wwwroot and dropped my scripts in there. Always worked
fine, no messing arround with virtual directory's.....
 
There seems to be some confusion as to what an "application" is. In web
server lingo the word application defines an execution context and often a
machine process. An application is defined by a folder hierarchy, with all
files under the application folder/subfolders belonging to that application.
The "main" IIS application is set up under inetpub\wwwroot. If you drop in
files under that folder (or subfolders) then you run in the main application
context, and you will share the Application object with all other pages in
that context.

Most non-trivial applications are set up as isolated applications and thus
require a special IIS designation (virtual directory). This is not
mandatory, however. Nor is it mandatory, I believe, in asp.net.

There is no mapping between IIS applications and .NET projects. A single
application may be spread over multiple folders each consisting of one or
more projects (solutions). If you want to drop your application that way
under wwwroot then I believe you'd be fine, although I'm not sure this is
the best way to go. Perhaps better to define a (single!) virtual directory
in IIS and dump it all in there. The crucial point is you don't need a
separate application for each folder/project.

Eran
 
Thank you for your reply Eran,

The theory is now clear to me, but in practice it isn't working. Let me use
an example to be more specific:

I have 2 VS.NET projects which I made on my development machine, let's say
Project1 and Project2. On my develop machine they both reside in the wwwroot
of IIS. These project each have an own virtual directory since VS.NET makes
a new application for every project.

Now I like to deploy these projects to my production server. I could drop
them in the wwwroot of the production server, but I want an own application
(1) for these 2 applications. So let's make 1 virtual dir in the wwwroot of
the production server, let's say "MyProjects". Then I copy the contents of
the Project1 and the Project2 map to this MyProject map on the production
server.

When I surf to the application the form is displayed, but no controls are
displayed. I'm only seeing some labels, the buttons which are on the page
disappeared.

Tried the same trick on my local machine, so made a new virt dir in the www
root named "MyProjects" and also copied the folders Project1 and Project2 in
there. But then I'm also getting some errors. Project2 has got a web.config
file and project1 doesn't.

http://members.home.nl/gerbenvl/Project1_error.gif
http://members.home.nl/gerbenvl/Project2_error.gif

Hope someone can help, thanks in advance.

Greets,

Gerben van Loon
 
Gerben,

I am not an expert on how to set up an aspx application under IIS and I hope
I'm not misleading you in the specifics. It seems you can have multiple
web.config files in different folders of the same application but some
settings are only applicable at the root level of the application. I'm not
sure why you need the config file to begin with but you can probably modify
the files to get it right. (Perhaps as a first step just move the config
file to your application's root.

If I understand your setup correctly, you set up a virtual directory under
wwwroot. This folder is empty, except for two subfolders - project1 and
project2, to which you copied the application files. First, note that each
of the subfolders has to have a bin subfolder with the compiled executables.
I suspect the absence of this folder is what caused the proj1 failure.

Another option is the virtual directory is not set up properly. I would try
setting it to someplace other than wwwroot. Set up a folder directly under
c:\ and create a virtual directory pointing there. By putting there a simple
html file and accessing it correctly from a browser you know for sure the
virtual directory is set up properly. Then you know you are not confused
with the main application.

Hope this helps,
Eran
 
Yes each project folder had a bin directory with the compiled dll in it. The
virtual diretory is setup ok, I tested it with a simple html page. I also
tried to make a vitrual directory directly under the c:\. But i'm still
getting the same error of project1:

Http://members.home.nl/gerbenvl/Project1_error.gif

Hope somebody can help,

Gerben.
 
Back
Top