Recommended Deployment Practice?

  • Thread starter Thread starter Med
  • Start date Start date
M

Med

Hi,

I use the following script to deploy my asp.net 3.5 application to
production server:

aspnet_compiler.exe -p "c:\projects\myapp" -v / -u -f "c:\Compiled_for_live"

Before running above line I set "Configuration Manager>Active solution
configuration" to Release, clean and rebuild the solution in VWD express.

Then I copy and past entire "Compiled_for_ive" folder to the live
application folder. I also noticed some pdb filed in
"c:\Compiled_for_live\bin" for some reason! Is there a better way to deploy
pre-compiled application? like using msbuild.exe instead?


Kind Regards

Med
 
Here is mine.


MyBuild.bat <<File Name Put everything below (but not including this line)
in a .bat file


@echo off
ECHO When/If prompted with the question:
ECHO .

ECHO Does ".........." specify a file name or directory name on the
target
ECHO (F = file, D = directory)?
ECHO _
ECHO You should answer with "D" for directory.

ECHO _
ECHO _
ECHO _

ECHO When/If prompted with the question:
ECHO _
ECHO Overwrite (...........)
ECHO (Yes/No/All)?
ECHO _
ECHO You should answer with "A" for "All"
ECHO _

@echo on



set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727

call %msBuildDir%\msbuild MySolution.sln /p:Configuration=Release

Del /Q c:\wutemp\ReleaseBuild_MySolution\*.*

ECHO Winforms
XCOPY .\Presentation.Winforms1\bin\Release\*.*
c:\wutemp\ReleaseBuild_MySolution_Winforms /EXCLUDE:.\exclude.txt /e/s

ECHO Web
XCOPY .\Presentation.Web1\*.* c:\wutemp\ReleaseBuild_MySolution_Web
/EXCLUDE:.\exclude.txt /e/s


//END MyBuild.bat <<File Name


exclude.txt <<File Name Put everything below (but not including this line)
in a .txt file

..vbproj
..csproj
..scc
..resx
..vb
..cs
..snk
..pdb
..xsx
..xsd
..sln
..vssscc
..bat
exclude.txt
..config

END exclude.txt <<File Name


Create those 2 files.
Put them where the .sln file resides.


Double Click.

Answer the questions when prompted.

You're done. That's a RELEASE build with no fluff.



You'll have to tweak the path if its a web build or winforms. You only need
one of the 2 I supplied. (web or winforms lines)
 
Unfortunately, Web Deployment Projects are not supported with Visual Studio
2008 Express Editions.
 
if you get the web deploy project, you will see its mostly some addins
for msbuild (to handle the web.config modification) and a auto gen of
the msbuild file.

you should learn msbuild (also see the msbuild community tasks), and
while manual, its not very hard to create the build script.

you probably have debug=true in the web.config that is causing the pdb
files to be built. this is why you want a release and a debug
web.config. you can use the deployment proj addin for msbuild, but its
pretty poorly written, you might as well write your own.


see: http://msbuildtasks.tigris.org/


-- bruce (sqlwork.com)


Unfortunately, Web Deployment Projects are not supported with Visual
Studio 2008 Express Editions.
 
Hi All,

Thanks for your time and suggestions. I found this video tutorial
(http://www.asp.net/learn/3.5-videos/video-394.aspx) and trying to use
MSBUILD v3.5 with my VWD 2008 express.
you probably have debug=true in the web.config
Even though I set debug="false" in web.config, and Config Manager to
"Release" I still get the PDB files in bin folder for some reason!


Thanks Again.


Med

bruce barker said:
if you get the web deploy project, you will see its mostly some addins for
msbuild (to handle the web.config modification) and a auto gen of the
msbuild file.

you should learn msbuild (also see the msbuild community tasks), and while
manual, its not very hard to create the build script.

you probably have debug=true in the web.config that is causing the pdb
files to be built. this is why you want a release and a debug web.config.
you can use the deployment proj addin for msbuild, but its pretty poorly
written, you might as well write your own.


see: http://msbuildtasks.tigris.org/


-- bruce (sqlwork.com)
 
You might also want to take a look at NSIS (Nullsoft Scriptable Install System),
which is an open source system to help you create Windows installers.

http://nsis.sourceforge.net/Main_Page

You can create web installers, communicate with Windows and other
software components, install or update shared components and more.

Make sure you look at NSIS's numerous plugins :
http://nsis.sourceforge.net/Category:Plugins



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Mark,

Actually additional exception information comes handy, but could PDB files
on live server slow-down the application? Finally I know that using
msbuild.exe to deploy asp.net app onto production environment is more
configurable/flexible. But does deployed asp.net web application perform
better if published usnig MSBUILD.exe over aspnet_compiler.exe? Can you
spot any issues with my script?

aspnet_compiler.exe -p "c:\projects\myapp" -v / -u -f "c:\Compiled_for_live"


Thanks for your time.

Med
 
Thank you for your help Mark,

I think I stay with aspnet_compiler.
I also spent some time on VWD 2008 Express "Pulish" option when a web
project is selected(right click) in solution Explorer. However I noticed
"Publish" is only available if asp.net Web project is created as "File
System" and not "HTTP".


Thanks again

Kind Regards

Med
 
Back
Top