Open anthonychu opened 2 years ago
I just experienced this so it would have been helpful
@ChristopherL-STCU This version only targets net6.0. How did you update the package? Were you able to compile the app after upgrade?
Dependabot suggested the upgrade. I went back to Visual Studio and pulled up the UI for the NuGet package manager. It also showed the upgrade and so I upgraded. It did not compile afterwards, hence how I ended up here. After upgrading VS showed Microsoft.Azure.WebJobs.Extensions.Http
as no longer being used and showed compile errors for the Function Http Trigger Attributes.
I too experienced the same issue as @ChristopherL-STCU and I had the following errors
Downgrading back to v3.0.13 fixed the issue.
I also had trouble with this. In Visual Studio's Nuget Package Manager window I noticed a suggested update, so I applied it. This resulted in the following mess:
I tried a few things like restarting Visual Studio, cleaning and rebuilding etc to no avail, and ended up using
git restore
to roll it back.
@vijayrkn Do you know how we can prevent the VS NuGet UI from upgrading v3 apps to an incompatible SDK version?
@anthonychu - All these packages are targeting netstandard2.0 - https://github.com/Azure/azure-functions-dotnet-worker/blob/648473e4c770ec7b2f3703bd18e883b4650a91c6/build/Extensions.props#L4
That is why NuGet is suggesting them as applicable for all TFMs. If specific package versions would only work against a specific TFM, the right thing would be to target the package for that TFM.
https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/4.0.1 is only mentioning net6.0 dependencies. However VS (both 2019 and 2022) will allow you to update anyway, it just removes all the older dependencies. This is for a netcoreapp3.1 project.
So it looks like VS treats it a dependencies, instead of requirements.
We should consider this before we take teh v4 SDK out of preview.
/cc @soninaren