deployment - Publishing my asp.net mvc application via script and not Visual Studio -
deployment - Publishing my asp.net mvc application via script and not Visual Studio -
i dont know much honest you...
i have managed download mscommunity build , have managed utilize script below compile , build application, want asp.net mvc application "published" want same files when clicking "publish" within visual studio. current build file looks this:
<?xml version="1.0" encoding="utf-8"?> <project defaulttargets="build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- import msbuild tasks --> <import project="$(msbuildextensionspath)\msbuildcommunitytasks\msbuild.community.tasks.targets" /> <propertygroup> <configuration condition=" '$(configuration)' == '' ">release</configuration> <classlibraryoutputdirectory>c:\publish\</classlibraryoutputdirectory> <projectdir>..\petproject\</projectdir > <projecttestdir>$(projectdir)petproject.webui\</projecttestdir > <projectfile>$(projectdir)petproject.sln</projectfile > <testprojectfile>$(projecttestdir)petproject.webui.csproj</testprojectfile > </propertygroup> <!-- build projects calling project files generated vs --> <target name="build"> <msbuild projects="$(projectfile)" /> <msbuild projects="$(testprojectfile)" /> </target> </project> i phone call in command line using:
c:\windows\microsoft.net\framework\v3.5>msbuild.exe c:\projects\petproject\build \petproject.build help appreciated...
note: want avoid ci, nant etc. because dont know , ideally want above working first base, move onto other things ci or whatever else, dont want confuse myself much...
this should give same result publishing within visual studio:
<project defaulttargets="buildandpublish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <import project="$(msbuildextensionspath)\microsoft\visualstudio\v10.0\web\microsoft.web.publishing.targets" /> <propertygroup> <projectfile>c:\petproject\petproject.csproj</projectfile > <outdir>c:\petproject\mypublish</outdir> </propertygroup> <target name="buildandpublish"> <msbuild projects="$(projectfile)" targets="package" properties="configuration=release;packagelocation=$(outdir)\msdeploy\package.zip;_packagetempdir=$(outdir)\temp" /> </target> </project> for project.
don't forget import microsoft.web.publishing.targets contains package target (which mixed publish in inital answer).
if want build solution script should this:
<project defaulttargets="buildandpublish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <import project="$(msbuildextensionspath)\microsoft\visualstudio\v10.0\web\microsoft.web.publishing.targets" /> <propertygroup> <outdir>c:\petproject\mypublish\</outdir> </propertygroup> <itemgroup> <solution include="c:\petproject\petproject.sln"> <properties> outdir=$(outdir); platform=any cpu; configuration=release; deployonbuild=true; deploytarget=package; packagelocation=$(outdir)\msdeploy\package.zip; _packagetempdir=$(outdir)\temp </properties> </solution> </itemgroup> <target name="buildandpublish"> <msbuild projects="@(solution)" /> </target> </project> there's a blog post code inside describes same approach didn't work when tried in environment.
asp.net-mvc-2 deployment msbuild
Comments
Post a Comment