Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent accidentally updating v3 app to use v4 SDK #533

Open
anthonychu opened this issue Oct 18, 2021 · 8 comments
Open

Prevent accidentally updating v3 app to use v4 SDK #533

anthonychu opened this issue Oct 18, 2021 · 8 comments

Comments

@anthonychu
Copy link
Member

We should consider this before we take teh v4 SDK out of preview.

/cc @soninaren

@ChristopherL-STCU
Copy link

I just experienced this so it would have been helpful

@anthonychu
Copy link
Member Author

@ChristopherL-STCU This version only targets net6.0. How did you update the package? Were you able to compile the app after upgrade?

@ChristopherL-STCU
Copy link

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.

@coder-candace
Copy link

I too experienced the same issue as @ChristopherL-STCU and I had the following errors
image
Downgrading back to v3.0.13 fixed the issue.

@soninaren soninaren added this to the Triaged milestone Oct 22, 2021
@SteffenLG
Copy link

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:
image
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.

@anthonychu
Copy link
Member Author

@vijayrkn Do you know how we can prevent the VS NuGet UI from upgrading v3 apps to an incompatible SDK version?

@vijayrkn
Copy link
Collaborator

vijayrkn commented Nov 1, 2021

@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.

image

@raymens
Copy link

raymens commented Nov 2, 2021

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.

image

@fabiocav fabiocav removed this from the Triaged milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants