Azure-functions-vs-build-sdk: error MSB4062: The "GenerateFunctions" task could not be loaded from the assembly C:\Users\VssAdministrator\.nuget\packages\microsoft.net.sdk.functions\1.0.27\build\netstandard1.0\..\..\tools\netcoreapp2.1\\Microsoft.NET.Sdk.Functions.MSBuild.dll. Assembly with same name is already loaded Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Created on 12 Jun 2019  路  8Comments  路  Source: Azure/azure-functions-vs-build-sdk

On trying to build the solution in VSTS, it gives the following error

error MSB4062: The "GenerateFunctions" task could not be loaded from the assembly C:\Users\VssAdministrator.nuget\packages\microsoft.net.sdk.functions\1.0.27\build\netstandard1.0....\tools\netcoreapp2.1\Microsoft.NET.Sdk.Functions.MSBuild.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\a\1\s\RPSolutionAzureFunctionsV2\RequisitionAdapter\ICIMSRequisitionAdapter\MS.IT.AttractTalent.Function.ICIMSRequisitionAdapter.csproj]

Most helpful comment

If you're building more than one functions project in the same pipeline, you might want to check that they all reference the same version of the Microsoft.NET.Sdk.Functions package.

All 8 comments

If you're building more than one functions project in the same pipeline, you might want to check that they all reference the same version of the Microsoft.NET.Sdk.Functions package.

I have the same issue since "forever". The two functions projects are in two completely different solutions.

Now, to fix it, I have to:

1) close VS
2) go to c:\users\MYUSERNAME\.nuget\packages\microsoft.net.sdk.functions
3) delete offending older versions of the library
4) open VS, load the solution and build it again

The problem is fixed until when I have to load the other solution and build it. Then it comes back. I tried keeping both solutions open in two VS instances. It does not help.

Very annoying. I wish this was already fixed.

Functions were referring different versions of sdk.

For other people's benefit, this can also happen across solutions/builds due to MSBuild reusing long-running worker processes. Solution is to pass /nr:false to MSBuild or to set the environment variable MSBUILDDISABLENODEREUSE=1. That's how we solved it on our CI system. More info here: https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/MSBuild-Tips-&-Tricks.md

@nikagarwal25 Why was this issue closed without a solution or link to a workaround?

Any update on this issue?

Any update on this issue?

This has been resolved. It was due to different azure functions in the solution were referencing to different sdk version.

Any update on this issue?

This has been resolved. It was due to different azure functions in the solution were referencing to different sdk version.

Thank you for the update.

Was this page helpful?
0 / 5 - 0 ratings