Unable to build Compiled Azure Function in VSTS (Error MSB4019) - azure

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?

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.

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

Related

how install libvips NetVips in Azure cloud - Error:Unable to load DLL \ 'libvips-42.dll\ ' or one of its dependencies

I can run an azure function app with libvips library from localhost for this function app - manipulation for images output correctly. I setup my local environment by saving libvips win64 in a folder in my windows 10 PC, added libvips bin folder to environment PATH and in Visual studio I installed nuget NetVips, NetVips.Native.win-64.
This is the method I run :
var rgbThumbnail = NetVips.Image.ThumbnailBuffer(thisRGBImgBytes, 256);
I'm trying to run the .Net Core 3.1 V3 function app from azure. When I run from cloud I get "Error:Unable to load DLL \ 'libvips-42.dll\ ' or one of its dependencies. The specified module could not be found . (0x8007007E)"
I had expected for the nuget packages in VS to suffice when uploading to the function app in azure. I've looked on the internet how to install libvips in Azure but I can't find any reference. Can someone please help?
thank you
Had similar problems.
Libvips is using more then one dll.
Download from
https://libvips.github.io/libvips/
Add all dll's then remove one by one.
Or directly identify the missing dll.
In Visual Studio, right-click your Azure Functions project, then click on Manage NuGet Packages, and install the following packages:
NetVips (latest version)
NetVips.Native (latest version)
That should solve the issue related to missing DLLs.

Build works locally and fails in Azure

I have a project in C Sharp which build correctly in my local machine ( as well as in the one from my colleagues ). But when we try to configure the pipeline in Azure, in the step of Nuget restore everything stops and we get an error message stating that package "A" is not compatible with netcore 2.2, as well as package B,C,D,etc.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
Why is it possible to see this error in Azure but not in my local? The project is setup to use netcore 2.2 and builds fine in my local machine.
This error can occur with an outdated version of nuget. The default version of NuGet running in the VSTS pipeline was not the latest one.
So, to resolve this issue, there is a nuget version installer task which you can run as part of your build step to upgrade the version of nuget running in your build pipeline:
Besides, if update nuget version not resolve this issue, please check the SDK version on the build agent is same as your local, you can use the task Use .NET Core to update the SDK version.
Hope this helps.

Azure DevOps Build Solution using wrong version of package

I've got a 'Build Solution' step for a ASP.NET project in Azure DevOps and it's failing because it's trying to use an old version of a package. In my code it's only referenced in the packages.config and I've changed that entry to use version 1.0.7, but in Azure DevOps it's still trying to find 1.0.2 but fails to find it. Any ideas why it's trying to use the wrong package version or how to force it to get the new one? My project in visual studio has no references to the old version.
There were references in the .csproj file that were trying to access the old file path, and that version of the package did not exist at that path. So I took the bad path out and it fixed the issue
Probably one of your NuGet packages requires version 1.0.2 of the package. To figure out which one, delete the local version 1.0.2 and build the solution locally. Then take a look at the build output and see which package is missing that version. Maybe take a look here:
Increase Build Log Verbosity to Get More Details About a Build Problem

Error Copying Typescript files when packaging Azure project - Visual Studio 2015 Update1

After updating to VS 2015 Update 1 (including Typescript 1.7) and the Azure SDK 2.8, I am unable to package my Azure application for deployment because of an error in the path the packager is trying to copy the js output file to:
Error Unable to copy file "D:\X\XX\XXX\App\services\editor\ruler-manager.js" to "D:\X\XX\XXX\obj\Debug\PE.Web\D:\X\XX\XXX\App\services\editor\ruler-manager.js". The given path's format is not supported. PE.Architecture C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Windows Azure Tools\2.8\Microsoft.WindowsAzure.targets 2787
Note that the directory has been included twice, causing an illegal colon in the middle of the output path.
It seems likely this is related to TFS Build error after installing Visual Studio 2015 Update 1 and https://social.msdn.microsoft.com/Forums/en-US/300a59bc-0f23-41a4-927a-05ae9978f3a4/unable-to-build-project-with-tyepscript-since-upgrading-to-vs-2015-update-1?forum=msbuild&prof=required and https://github.com/Microsoft/TypeScript/issues/5894
Update:
The following workaround has been suggested, but we were still unable to publish after implementing it:
We worked around it by manually adding ContinueOnError="WarnAndContinue" to the Copy task within the CopyWebRoleFiles target, within Microsoft.WindowsAzure.targets.
(Source: https://github.com/Microsoft/TypeScript/issues/5894#issuecomment-162261090)
Does anyone have any workarounds or fixes other than the ones suggested in the linked threads?
This was a bug in the Typescript 1.7 tooling. Fixes have been released:
For VS 2015 (TS 1.7.6)
For VS 2013 (TS 1.7.5)
Details here: https://github.com/Microsoft/TypeScript/issues/5894#issuecomment-163798025

Package / Publish error on Azure

I've recently upgraded an Azure Project from Azure SDK 1.6 (Visual Studio 2010) to Azure SDK 2.0 (Visual Studio 2012). The project will build with no errors or warnings on the local machine. I can debug on the local machine, but I cannot package or get a build on the build server. The error I get is:
error MSB4057: The target "PipelineTransformPhase" does not exist in the project.
I've confirmed that the C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplications.targets file exists locally and on the build server.
The original project pointed to the \v10.0\ path and I manually changed that to the \v11.0\ path trying to resolve the error with no luck.
I have noticed that when project is not able to access Microsoft.WebApplications.targets file it usually says "The target "PipelineTransformPhase" does not exist in the project."
You need to import Microsoft.WebApplications.targets file into the project. You can do it by adding following line in your project.
<Import Project="C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" />
When importing Microsoft.WebApplication.targets into the project file, make sure you don't set explicit Condition="false". I have seen similar error when Microsoft.WebApplication.targets was imported to the project along with Condition="false".
One more thing to consider when importing Microsoft.WebApplication.targets into project file, always make sure that default variable $(MSBuildExtensionsPath32) is set to "C:\Program Files (x86)\MSBuild\".

Resources