OpServer – Build Web Deploy package ( from command line)


It is easy to build through the Visual Studio GUI.

But, one misses out on knowing what is happening behind the scene.



Here is a command line DOS batch file that creates OPServer via MSBuild.exe.

Dos batch file

@echo off


set "_dirMSBuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\"

set "_dirSource=extract\Opserver-master\"
set "_fileSolution=Opserver.sln"

set "_folderPackage=WebPublish"

rem package file system
set "_Option01=   /p:PackageLocation=%_folderPackage%  "

rem packaging options
set "_Option02=  /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true "

rem configuration options
set "Option03=  /p:Configuration=Release "

rem connection string
set "_Option04= /p:AutoParameterizationWebConfigConnectionStrings=false "

set "_packageOption=%_Option01% %_Option02% %_Option03% %_Option04%"

echo "Package Option is %_packageOption%"

"%_dirMSBuild%\msbuild.exe" %_dirSource%\%_fileSolution%    %_packageOption% 


Build Log

Here is our msbuild log output captured using tee.exe

"Package Option is    /p:PackageLocation=WebPublish     /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true    /p:AutoParameterizationWebConfigConnectionStrings=false "
Microsoft (R) Build Engine version for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Creating directory "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\".
  $(_DefaultMSDeployMaxVersion) is 3
  $(_MSDeployVersionsToTry) is 9.0
  $(MSDeployPath) is C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\
  Generate source manifest file for Web Deploy package/publish ...
  Packaging into C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.zip.
  Starting Web deployment task from source: manifest(C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.SourceManifest.xml) to 
  Destination: package(C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\WebPublish\Opserver.zip).

  Adding declared parameter 'IIS Web Application Name'.
  Successfully executed Web deployment task.
  Package "Opserver.zip" is successfully created as single file at the following location:

Build succeeded.
    0 Warning(s)
    0 Error(s)

  C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v temp -p C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver 
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\Opserver.csproj" (default targets).
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver\Opserver.csproj" (default targets).
Done Building Project "C:\Downloads\StackExchange\OPServer\20180326\extract\Opserver-master\Opserver.sln" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:48.33

Deploy Folder

Here is the deploy folder.

It is created under the folder specified in the packageLocation passed along to the msbuild executable.


In subsequent posts we will touch on the troubles we ran into trying to deploy the past.



  1. vijayrkn
    • vijayrkn/ASPNetPublishSamples

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s