simple question

  • Thread starter Thread starter Allan Rojas
  • Start date Start date
A

Allan Rojas

Hi there, i'm having this problem and i hope someone can help me out.

We have this WebApplication in ASP.NET; we work on it in our local
webserver. When we're done, we must upload the application to the FTP
located in our hosting location.

The first time it was a full-upload of the project files, and a minor change
to the Web.Config in order to access the right databse. But now, if i make a
MINOR change to a code-behind file, how do i replicate the changes without
having to recompile the whole project and make the whole process again?

* I though that if i replaced the .cs / .vb file and reloaded the
application, it would detect the change and recompile it automatically...
but it won't work.

* Then i though that if i deleted the DLL file in the BIN subdirectory, it
would recompile and generate it... but it won't work either.

* Finally, i though that if i deleted the aspx files and tried to access the
application, the server would realize it was no longer available; and if i
added the files again and tried to access it again, it would recompile it...
but i was just dreaming...

I'm just starting to work with ASP.NET and i simply can't believe that the
only way i can get my MINOR change reflected is by recompiling the WHOLE
application or replacing the pre-compiled DLL ...

Any suggestion or tip ? Thanks in advance.
 
If I understood you corrrectly...
If all you did was modify the .CS of a page, just recomile the site on your
machine and upload the .DLL from your compile to the live site's BIN folder.
That should be all you need to do.
 
So it's true, that's the only way to get my changes reflected ? Recompile
the whole project for each minor change, no matter how minor it is... ?

Damn... this is tedious... i must confess i'm dissapointed of this
*code-behind* thing...
 
Allan,

First, you shouldn't have ANY .vb files out on your production server. All
the code-behind in all of your pages gets compiled into the application's
main .dll file.

Here's the best way I've found to optimize your application and get just the
files you need for production:

1. Set your application output to: Release

2. In your web.config file make sure to set debug="false"
<compilation defaultLanguage="vb" debug="false" />

3. In the solution explorer window of Visual Studio.Net
select your web project by left clicking on it once.

4. In the application menu click: Project - Copy Project

5. In the Copy Project window that opens the recommended
web access method is "File Share".

6. Set to: "Only files needed to run this application"
in the "Copy" section

7. This will make a copy of your application (note the
destination) for deployment to your production server.

Notes:

If you make a visual only change to your application. (i.e. You move the
location of a control in a .aspx file or change text placed right in the
html you just need deploy that .aspx file to have your change take effect.
Any changes to an object's properties or to the application's code behind
require the .dll to be recompiled and deployed.

If all you've changed is the code behind and no .aspx pages have been
changed (i.e. no objects added or subtracted from the display of a page.)
then all you need to do to deploy the applcation changes is copy and paste
the main application.dll.

If you've changed the display page and made a code behind change (i.e. added
an object) then just deploy the .aspx file(s) that changed and the main.dll.

Most changes that aren't major will usually only require you to upload two
or three files to the web server at any given time.

I hope this helps.



--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Allan said:
So it's true, that's the only way to get my changes reflected ?
Recompile the whole project for each minor change, no matter how
minor it is... ?

Damn... this is tedious... i must confess i'm dissapointed of this
*code-behind* thing...

For easier Development, you can just use a "SRC=" attribute in your
@PAGE class.

Once you have this attribute, it will automatically compile your
codebehind file to a temp dir.

I wouldn't recommend deploying it this way to production.
 
Back
Top