Publishing Website Through Command Prompt.

2010-05-23

It's possible to publish the asp.net website through command prompt using aspnet_compiler tool in the .net tools.

@ECHO OFF

set WEB_ROOT=E:\Quadra.NET\ClientRelated\PUBLISH

set PROJECT_ROOT=E:\Quadra.NET\ClientRelated\QuadraDev\SourceCode\QuadraWEB

GOTO EndComment

============================================================

SET PATH TO visual studio command prompt

============================================================

:EndComment

set path=%windir%\Microsoft.NET\Framework\v2.0.50727;path=%path%;

RMDIR "%WEB_ROOT%" /s

MD "%WEB_ROOT%"

aspnet_compiler -v QuadraWeb -p "%PROJECT_ROOT%" -u -f -d -fixednames "%WEB_ROOT%"

pause


Save it as .bat file.

set WEB_ROOT=E:\Quadra.NET\ClientRelated\PUBLISH
set PROJECT_ROOT=E:\Quadra.NET\ClientRelated\QuadraDev\SourceCode\QuadraWEB

where WEB_ROOT is your destination folder
PROJECT_ROOT is where your asp.net pages are located.

NOTE:> Remove publishing with debug=true in web.config, as it affects the performance of application badly.
* Run .bat as Administrator if Access is denied
* A project targetting .NET 4.0 set path as
set path=%windir%\Microsoft.NET\Framework\v4.0.30319;path=%path%;

0 comments: