0

I'm attempting to use the build system in VSTS to build and deploy a c# .net web app. I've created a new single-project solution (as there doesn't seem to be any way to specify which project to build/deploy in a multi project solution!?!) and set up my build definition to point to this new solution. I've set it up to use the VS2017 build agent.

The NuGet restore completes and it begins to build but fails with the error:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(124,7): Error MSB4184: The expression "[System.IO.Path]::GetDirectoryName('')" cannot be evaluated. The path is not of a legal form.

Has anyone encountered this and knows how to fix it? Thanks

LDJ
  • 6,896
  • 9
  • 52
  • 87

2 Answers2

3

I know this might be bit late, but if it helps anyone then they should install the extension VSColorOutput

Then go to Tools => Options => VSColorOutput => General => Set Stop Build on First Error to true.

Mohamad Mousheimish
  • 1,641
  • 3
  • 16
  • 48
user13309289
  • 217
  • 2
  • 8
  • VSColorOutput is a great help but Stop Build on First Error does not work for me (large Fortran project), it happily keeps on building. – lineinthesand Nov 13 '20 at 08:23
1

Using .Net Core step/task instead. (Command: publish; Arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory))

Similar issue: VSTS fails to build my really really simple ASP.NET Core app

Community
  • 1
  • 1
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53