BellaGurl
BellaGurl

Reputation: 109

Azure Pipeline deploy to Web App Service failing with Missing required property 'OutputPath'

I am running into an issue with deploying to Azure Web App resource I've got set up. I can't find much about this error online so posting here...

I have a .NET solution with a main project and several class library projects which i make references to in my main project.

For some reason, the deployment is failing because it doesn't pick up those dll projects in the solution. My code is on a bitbucket repo and I've set it to deploy to my web app resource whenever I make a commit to a certain branch.

But it is failing with this error:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
Invalid restore input. Missing required property 'OutputPath' for project type 'PackageReference'. Input files: D:\home\site\repository\XXXCode\XXXXX.Entities\XXXXX.Entities.csproj.
Failed exitCode=1, command=nuget restore "D:\home\site\repository\XXXCode\XXXCode.sln"
An error has occurred during web site deployment.
Invalid restore input. Missing required property 'OutputPath' for project type 'PackageReference'. Input files: D:\home\site\repository\XXXCode\XXXXX.Entities\XXXXX.Entities.csproj.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\82.10503.3890\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

Am i missing a step here? I'm new to this so I probably forgot a step somewhere. Any help greatly appreciated, thanks!

Upvotes: 1

Views: 890

Answers (1)

Mengdi Liang
Mengdi Liang

Reputation: 19026

MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin\amd64'.

According to this error message, apparently the version you are using is MSBuild 14.0(VS 2015 tools).

And also, from this message:

Missing required property 'OutputPath' for project type 'PackageReference'.

As far as I understood, the PackageReference just works with MSBuild version 15 and higher, instead of 14.0. Since it came with VS 2017, and at the same time MSBuild 15.0.

So, for solve this error, I recommend you try with the newer version: MSbuild 15.0.

You can also refer to this ticket: Missing required property 'OutputPath' for project type 'PackageReference'

Edit:

First, please ensure that your script can be executed successfully in VS2017 locally.

And then, if you build with Visual Studio build task, change the Visual Studio Version as:

enter image description here

Or, if its MSBuild task you are using, just need to change the MSBuild Version:

enter image description here

On the other hand, if you are using Specify Location instead of Version in MSbuild task, specify the location path of MSBuild.exe which under MSBuild 15.0. For me, I am using VS2019, so the location of MSbuild 16.0 is:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe

enter image description here

Update:

Since you are using VS2017, you can specified the location of MSbuild 15.0 with your MSbuild 15.0 file path as:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64

Upvotes: 1

Related Questions