Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
96 stars 62 forks source link

SDK 4.1.3 and Microsoft.Azure.WebJobs.Extensions.Http 3.2 breaks #589

Open tbasallo opened 1 year ago

tbasallo commented 1 year ago

Updating the Microsoft.NET.Sdk.Functions to 4.1.3 and uipdating Microsoft.Azure.WebJobs.Extensions.Http to which is requieed, causes for the runtime (locally) to not find it and error with "Could not load file or assembly Microsoft.Azure.WebJobs.Extensions.Http 3.2.0"

Downgrading to 4.1.1 and Http 3.0.12 works.

JonasJes commented 1 year ago

I have the same problem, got it solved locally by updating Azure Functions Core Tools But is was still failing while running in docker, so I also had to downgrade to 4.1.1 to get it running there as well.

Same problem in reported to stackoverflow 2 months ago

Could this be the root cause for this error? #695

ramya894 commented 1 year ago

@JonasJes We will check this issue with our next level team and update you.

kshyju commented 1 year ago

@tbasallo What is the core tools/host version you have? Is that the latest?

tbasallo commented 1 year ago

@kshyju yes. the latest (AFAIK). I also installed them separate from VS.

Azure Functions Core Tools Core Tools Version: 4.0.4785 Commit hash: N/A (64-bit) Function Runtime Version: 4.10.4.19213

kshyju commented 1 year ago

@tbasallo I could not repro this when I created a new in-proc dotnet 6 http function app. I upgraded my Microsoft.NET.Sdk.Functions package to 4.1.3 and Microsoft.Azure.WebJobs.Extensions.Http is 3.2.0, did F5 debugging on Visual studio and can see everything working as expected.

I am using VS 2022 17.3.6, which is the latest stable as of today. Do you see the same core tools version numbers when you do F5 on Visual studio? Or are you running the app in another way?

image

JonasJes commented 1 year ago

@kshyju Have you tried Dockerizing it and then running it?

kshyju commented 1 year ago

@kshyju Have you tried Dockerizing it and then running it?

Yes, I do not see any issues with running it in docker. If you are experiencing issues, please open a new issue so we can discuss the details there. Thanks!

lgp1985 commented 1 year ago

If I create an Azure Function project, and then run as is, it'll work, but if I go to Mange NuGet Packages and update to latest version available it'll fail to run, without any code changes, what am I missing here?

You can see all my steps on attached video.

https://user-images.githubusercontent.com/810024/196714150-0b92fbec-a6fc-44eb-9a49-c6fb93614144.mp4

kshyju commented 1 year ago

@lgp1985 Can you change the package source to "nuget.org" when upgrading the package to 4.1.3 and see what happens?

lgp1985 commented 1 year ago

Like this @kshyju ?

https://user-images.githubusercontent.com/810024/196772668-5c9d55da-7af4-441c-ba3f-62784b7c13a3.mp4

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

kshyju commented 1 year ago

@lgp1985 Can you share a minimal repro with us? A Github repo will be great. Thanks!

tbasallo commented 1 year ago

hmm...I've updated a few projects and haven't had any issues.

However, the tools did update: Azure Functions Core Tools Core Tools Version: 4.0.4829 Commit hash: N/A (64-bit) Function Runtime Version: 4.11.2.19273

Maybe that's why which matches @kshyju

lgp1985 commented 1 year ago

@lgp1985 Can you share a minimal repro with us? A Github repo will be great. Thanks!

Here's a repo https://github.com/lgp1985/defect-v4.1.3-azure-functions-vs-build-sdk with both failing and working projects under the same solution. Worth mentioning the issue is only reproducible in Windows 10, I provided some details on VS2022 and Windows version of an environment in which it works, and another that fails.

I can confirm other 3 developers have faced the same issue under Windows 10.

KevinAble commented 1 year ago

What fixed it for me was Close Visual Studio Delete folder C:\Users***\AppData\Local\AzureFunctionsTools Restart Visual Studio. Launch Application, folder gets recreate

taken from https://stackoverflow.com/questions/73645163/unable-to-upgrade-azure-functions-core-tools-exception-cannot-create-instance

lgp1985 commented 1 year ago

Hi @KevinAble, that had no difference on Windows 10 for me

https://user-images.githubusercontent.com/810024/199338378-f9e75581-ca2f-4c25-b9e0-5d9e53021ca1.mp4