-
Notifications
You must be signed in to change notification settings - Fork 451
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
Cannot use System.Interactive.Async v4+ in .NET Azure Function #6336
Comments
Thanks for the elaborate issue! @fabiocav and @brettsam, would either of you have thoughts on this one? Wondering if we can update our reference of |
I encountered a same problem. Currently, using <PropertyGroup>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup> However, |
I really apologize for the super long delay here. I missed providing any updates on this. I don't think we could remove or update the major version of that package without being potentially breaking. As this is a Host runtime dependency, the way to keep the v4 of that dependency in the build artifacts would be one of two approaches --
Note that this is only supported in
I will leave this issue open in case people have further questions. Once again, I apologize that I missed providing any updates here. |
@ankitkumarr |
If you add a reference to v4.1.1 of the
System.Interactive.Async
NuGet package to an Azure Functions project, you cannot use it because theRemoveRuntimeDependencies
build task defined in this repo deletes it from your build output.The code that performs the deletion lives in this repo at https://github.com/Azure/azure-functions-host/blob/1ed2a54159eb3c9aaff11a9289be2bf1ce91dcb5/tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/BuildTasks/RemoveRuntimeDependencies.cs, specifically:
azure-functions-host/tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/BuildTasks/RemoveRuntimeDependencies.cs
Lines 26 to 42 in 1ed2a54
The list of files this uses is also in this repo, and the offending entry is at
azure-functions-host/tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator/runtimeassemblies.txt
Line 228 in 1ed2a54
The rationale for this appears to be that Functions already brings its own copy - see #6208
But the problem is that this appears to be a v3.x era
System.Interactive.Async
which uses a definition ofIAsyncEnumerable<T>
that is incompatible with C# 8.0'sawait foreach
. The PR at dotnet/reactive#423 modifiedSystem.Interactive.Async
to work with the new definition of this interface. This first became available in v4.0.The main reason I was trying to use the features in
System.Interactive.Async
at all was to be able to useawait foreach
, so being prevented from using v4.x defeats the purpose for me.(In the project I encountered this problem I was attempting to use the
Buffer
extension method thatSystem.Interactive.Async
defines. ThisBuffer
method is not available onIAsyncEnumerable
unless you add a reference toSystem.Interactive.Async
, and although the v3.x version supported in Functions does defineBuffer
, it does it for the wrong, old version ofIAsyncEnumerable<T>
.)Investigative information
Version information:
NuGet packages:
Microsoft.NET.Sdk.Functions
v3.0.8System.Interactive.Async
v4.1.1The local functions emulator displays this:
I'm not providing any cloud information because this problem occurs at build time. (It causes runtime problems, but you can see those in the local emulator)
Repro steps
1 Select Timer trigger
3.0.8
and click UpdateSystem.Interactive.Async
4.1.1
)Function1.cs
Run
method, addlog.LogInformation(typeof(AsyncEnumerableEx).AssemblyQualifiedName);
An error occurs.
Expected behavior
The expected behaviour is that when the timer fires, it displays the assembly-qualified name of the
AsyncEnumerableEx
type in the log output. In fact, that's exactly what happens if you use Microsoft.NET.Sdk.Functions v3.0.3:Actual behavior
Although it works in the emulator with the 3.0.3
Microsoft.NET.Sdk.Functions
package, it doesn't with3.0.8
. You get this output instead:The text was updated successfully, but these errors were encountered: