Started getting Microsoft.Azure.SignalR.Management: Could not load file or assembly Microsoft.Extensions.Options after upgrading to the latest NuGet packages
See original GitHub issueThe following upstream signalR trigger function has been working well until we upgraded the NuGet packages to the latest versions.
[Function("OnConnected")]
[SignalROutput(HubName = "myhub")]
public async Task<SignalRMessageAction> OnConnectedAsync([SignalRTrigger("myhub", "connections", "connected")] SignalRInvocationContext invocationContext)
{
// do some stuff
return new(target!)
{
ConnectionId = invocationContext.ConnectionId,
Arguments = new object[] { "something" }
};
}
The issue is that we started getting the following runtime exception:
Microsoft.Azure.WebJobs.Host: Error indexing method ‘Functions.OnConnected’. Microsoft.Azure.SignalR.Management: Could not load file or assembly ‘Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’. The system cannot find the file specified.
We inspected the NuGet package references and found that we are not referencing Microsoft.Azure.SignalR.Management
in our packages list.
Repro steps
Create an upstream signalR function in a .NET 7.0 dotnet-isolated v4 function app and add the following NuGet packages:
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.14.1" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.10.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.SignalRService" Version="1.10.0" />
Expected behavior
The mentioned exception should not happen.
Actual behavior
The following exception happens:
Microsoft.Azure.WebJobs.Host: Error indexing method ‘Functions.OnConnected’. Microsoft.Azure.SignalR.Management: Could not load file or assembly ‘Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’. The system cannot find the file specified.
Known workarounds
Unknown
Related information
Provide any related information
The dotnet version is 7.0.304
Issue Analytics
- State:
- Created 3 months ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
I believe the issue is caused by the target framework changes since Microsoft.Azure.SignalR and Microsoft.Azure.Common 1.15.1 . where .NET 6.0 and .NET 7.0 are added as target frameworks of those two packages and somehow changed the dependency resolution process on .NET 7.0.
I’m trying to figure out whether this only occurs in .NET isolated worker runtime or if it’s a common behavior on .NET 7.0 .
@Arash-Sabet Thanks for reporting the issue. I’m still investigating now.