Automatically Deploying ASP.NET Web Site Project with TFS 2013 Build

I have an ASP.NET Webforms Website project (note that this is NOT a WebApplication project, i.e. no .csproj).

I want to do an automatic deployment, file system for a network share.

I created a profile and so there is a site.publishproj file and an xml profile.

I tried adding this to the MSBuild arguments in the build definition:

website.publishproj / p: DeployOnBuild = true / p: PublishProfile = MyDevProfile / p: VisualStudioVersion = 12.0

I am getting this error:

MSBUILD: Error MSB1008: Only one project can be specified. Switch: website.publishproj

Any idea what I am doing wrong? I believe it has to do with the project type of the website.

This is what I read: How to use the msbuild command line to deploy a VS2012 website project without compiling it first?

Here is the command:

C: \ Program Files (x86) \ MSBuild \ 12.0 \ bin \ amd64 \ MSBuild.exe / nologo / noconsolelogger "E: \ Builds \ 1 \ TP1 \ MyWebsite_Dev \ SRC \ Sites \ MyWebsite \ MyWebsite.sln" / nr: False / fl / flp: "logfile = E: \ Builds \ 1 \ TP1 \ MyWebsite_Dev \ src \ Websites \ MyWebsite \ MyWebsite.log; encoding = Unicode; verbosity = normal" / p: SkipInvalidConfigurations = true website.publishproj / p: DeployOnBuild = true / p: PublishProfile = DropToDemoProfile / p: VisualStudioVersion = 12.0 / m / P: OutDir = "E: \ Builds \ 1 \ TP1 \ MyWebsite_Dev \ Bin \" / p: VCBuildOverride = "E: \ Builds \ 1 \ TP1 \ MyWebsite_Dev \ src \ Websites \ MyWebsite \ MyWebsite.sln.vsprops "/ dl: WorkflowCentralLogger," C: \ Program Files \ Microsoft Team Foundation Server 12.0 \ Tools \ Microsoft.TeamFoundation.Build.Server.Logger.dll "; "Verbosity = Normal; BuildUri = vstfs: /// Build / Build / 35;IgnoreDuplicateProjects = False; InformationNodeId = 13; TargetsNotLogged = GetNativeManifest, GetCopyToOutputDirectoryItems, GetTargetPath; LogWarnings = True; TFSUrl =http://mytfs:8080/tfs/colletionname

; "* WorkflowForwardingLogger," C: \ Program Files \ Microsoft Team Foundation Server 12.0 \ Tools \ Microsoft.TeamFoundation.Build.Server.Logger.dll ";" Verbosity = Normal; "/ P: BuildId =" 7d23530d-7349-406f -98b7-5d4f0b9f4101, vstfs: /// Build / Build / 35 "/ p: BuildLabel =" MyWebsite_Dev_20141122.13 "/ p: BuildTimestamp =" Sun, 23 Nov 2014 01:22:05 GMT "/ p: BuildSourceVersion =" LMyWebsite_Dev_20141122.13 @ $ / TP1 "/ P: BuildDefinition =" MyWebsite_Dev "

+3


source to share


2 answers


You are trying to build solution ( MyWebsite.sln

) and project ( website.publishproj

) at the same time as part of the same MSBuild command, at least as per the arguments passed.

You can run msbuild website.publishproj /pp:website.pp.publishproj

to see which targets you can call in website.pp.publishproj

or which properties to override.



You can run set MSBUILDEMITSOLUTION=true && msbuild MyWebsite.sln

to see which targets you can call on MyWebsite.sln.metaproj

and MyWebsite.metaproj

or which properties to override.

Your command is DeployOnBuild

fine and should work, I am assuming your TFS config build is pointing to .sln

and passing website.publishproj

as an argument and not the main build target, so either reinstall it to build .publishproj

directly or ... well it looks like there is no alternative, you can try adding new configuration and edit .sln

with new AspNetConfiguration

and MyDevProfile.AspNetCompiler.TargetPath

, but then you're just asking about problems.

+2


source


You need to update your website to a web application for any of them to be automatic.

Its a fairly straightforward procedure and even on sites with thousands of pages, I completed the migration in just a few days from one person without affecting other developers.



The website functionality has been included for over 10 years. Although it still exists in the back-compat product, I would not recommend using it.

0


source







All Articles