Azure / Azure/azure-functions-dotnet-worker
AzureFunctionsVersion is set to an incompatible version
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
### What version of .NET does your existing project use?
.NET 6
### What version of .NET are you attempting to target?
.NET 8
### Description
I'm trying to upgrade my second Function App project from .net 6 (in-process) to .net 8 (isolated). The first one succeeded, but the second no matter what I've tried has an error `"AzureFunctionsVersion is set to an incompatible version"`.
The error is coming from `C:\Users\\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.2\build\Microsoft.Azure.Functions.Worker.Sdk.targets`
This section:
```
```
As an experiment I put `` at the top of the section and my first, working project is spitting out "v4", but the second, failing project is spitting out "v0"!
The failing project csproj's contents are attached but it has always had a value of `v4` - it wasn't changed by the upgrade assistant.
I tried copying the contents of csproj from of the working project and it still fails.
I tried unloading the first project; I tried cleaning the solution; deleting the .vs file for the sln; and deleting the bin and obj folders but that didn't help.
I did see some strange warnings:
```
Severity Code Description Project File Line Suppression State Details
Warning (active) MSB4011 "C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.props" cannot be imported again. It was already imported at "C:\Users\\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Publish.props (13,3)". This is most likely a build authoring error. This subsequent import will be ignored. [(path to).csproj] ProjectName C:\Users\\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.2\build\Microsoft.Azure.Functions.Worker.Sdk.Publish.props 13
Warning (active) MSB4011 "C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\Sdks\Microsoft.NET.Sdk.Publish\Sdk\Sdk.targets" cannot be imported again. It was already imported at "C:\Users\\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Publish.targets (14,3)". This is most likely a build authoring error. This subsequent import will be ignored. [(path to).csproj] ProjectName C:\Users\\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.2\build\Microsoft.Azure.Functions.Worker.Sdk.Publish.targets 15
Warning (active) MSB4011 "C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VisualStudio\Managed.Functions\Microsoft.Azure.Functions.Designtime.targets" cannot be imported again. It was already imported at "C:\Users\\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.targets (65,3)". This is most likely a build authoring error. This subsequent import will be ignored. [(path to).csproj] ProjectName C:\Users\\.nuget\packages\microsoft.azure.functions.worker.sdk\1.17.2\build\Microsoft.Azure.Functions.Worker.Sdk.targets 56
```
### Project configuration and dependencies
```
net8.0
v4
(snipped)
<_FunctionsSkipCleanOutput>true
Exe
enable
PreserveNewest
PreserveNewest
Never
```
### Link to a repository that reproduces the issue
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.