Unable to build Compiled Azure Function in VSTS (E

2019-07-24 19:22发布

I have created an Azure Function using the latest build of visual studio 2017 (15.3.1).

This build allows me to do the:

New Project > Azure Function App approach

This produces a .csproj (not a .funproj file) and it's doesn't come bundled with a website or anything. I've tried .Net 4.6 and 4.6.1 as the target framework and neither have worked.

I get the following error in VSTS:

C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props (13, 3) C:\Users\Builder.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.props(13,3): Error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

There is no node in my .csproj file so I am not sure where it is getting that from.

I'm using the latest NuGet option in VSTS, I'm using the Latest VS Version option as well.

The build steps are:

  • Get Sources
  • NuGet Restore
  • Build Solution (MSBuild.exe exited with code '1' every time)

Is there any way to build (and then release) compiled .Net functions in VSTS at the minute?

2条回答
女痞
2楼-- · 2019-07-24 20:05

Looks like the machine is missing the latest dotnet cli. I'm not too familiar with VSTS build machines, but you'd need to get that on there somehow https://www.microsoft.com/net/download/core

查看更多
劫难
3楼-- · 2019-07-24 20:08

I was able to solve this by swapping the build agent from the "Default" group to the latest, "Hosted VS 2017" group, and that has compiled fine.

查看更多
登录 后发表回答