I have a ASP.NET Webforms Website project(note this is NOT WebApplication project i.e. there is no .csproj).
I want to do a auto deploy, file system to our network share.
I created a profile and so there is website.publishproj file and profile xml.
I tried adding this in MSBuild arguments in Build Definition:
website.publishproj /p:DeployOnBuild=true /p:PublishProfile=MyDevProfile /p:VisualStudioVersion=12.0
I get this error:
MSBUILD : error MSB1008: Only one project can be specified. Switch: website.publishproj
Any idea what am I doing wrong? I believe this has something to do with Website project type.
This is something I read: How to use command line msbuild to deploy VS2012 Web Site project without precompiling it?
Here is the command:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "E:\Builds\1\TP1\MyWebsite_Dev\src\Websites\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"
You're trying to build the solution (
MyWebsite.sln
) and the project (website.publishproj
) simultaneously as part of the same MSBuild command at least according to the arguments being passed.You can run
msbuild website.publishproj /pp:website.pp.publishproj
to see what targets you can call inwebsite.pp.publishproj
or what properties to override.You can run
set MSBUILDEMITSOLUTION=true && msbuild MyWebsite.sln
to see what targets you can call inMyWebsite.sln.metaproj
andMyWebsite.metaproj
or what properties to override.Your
DeployOnBuild
command is fine and should work, I'm guessing your TFS build config is pointing to the.sln
and passingwebsite.publishproj
as an argument rather than the primary target of the build, so either repoint it to build the.publishproj
directly or... well, there doesn't seem to be any alternative, you can try adding a new configuration and editing the.sln
with newAspNetConfiguration
andMyDevProfile.AspNetCompiler.TargetPath
but then you're just asking for trouble.