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

.Net: Bug: Unable to add the Microsoft.SemanticKernel NuGet package (version 1.31.0) to an Azure Function App targeting .NET 8 #9854

Closed
MuraliM opened this issue Dec 1, 2024 · 4 comments
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@MuraliM
Copy link

MuraliM commented Dec 1, 2024

Describe the bug
When adding the Microsoft.SemanticKernel NuGet package (version 1.31.0) to an Azure Function App targeting .NET 8, the application fails to process the blob when its uploaded. Failing to load Azure.Core: Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0

Azure Function

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<AzureFunctionsVersion>v4</AzureFunctionsVersion>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.3.2" />
		<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.5.0" />
	</ItemGroup>
	<ItemGroup>
	  <PackageReference Include="Microsoft.SemanticKernel" Version="1.31.0" />
	  <PackageReference Include="System.Memory.Data" Version="9.0.0" />
	</ItemGroup>
	<ItemGroup>
		<None Update="host.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="local.settings.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
			<CopyToPublishDirectory>Never</CopyToPublishDirectory>
		</None>
	</ItemGroup>
</Project>

Function trigger

public class Function1
{
    [FunctionName("Function1")]
    public void Run([BlobTrigger("loandocuments/{name}", Connection = "AzureWebJobsStorage")]Stream myBlob, string name, ILogger log)
    {
        log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");

        
    }
}

Error

For detailed output, run func with --verbose flag.
[2024-12-01T18:40:41.485Z] An unhandled exception has occurred. Host is shutting down.
[2024-12-01T18:40:41.486Z] Azure.Core: Could not load file or assembly 'System.Memory.Data, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Additional information
I have tried updating System.Memory.Data to version 8.0.0 as well to 9.0.0 and no luck..
I think the issue #5226 is still occuring with System.Memory.Data.
When I run dotnet list package --include-transitive
Image

@MuraliM MuraliM added the bug Something isn't working label Dec 1, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 1, 2024
@github-actions github-actions bot changed the title Bug: .Net: Bug: Dec 1, 2024
@markwallace-microsoft markwallace-microsoft changed the title .Net: Bug: .Net: Bug: Unable to add the Microsoft.SemanticKernel NuGet package (version 1.31.0) to an Azure Function App targeting .NET 8 Dec 2, 2024
@evchaki
Copy link
Contributor

evchaki commented Dec 2, 2024

@MuraliM - thanks for trying this out. @markwallace-microsoft is going to take a look and see why this is not working.

@MunozVictor
Copy link

Version 1.29.0 had a change in that reference and it doesn't work either:

  • System.Memory.Data.1.0.2 -> System.Memory.Data.6.0.0.

Version 1.28.0 does work for me (.net 8).

@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Progress to Sprint: Planned in Semantic Kernel Dec 10, 2024
@markwallace-microsoft markwallace-microsoft moved this from Sprint: Planned to Sprint: In Progress in Semantic Kernel Dec 11, 2024
@dmytrostruk
Copy link
Member

@MuraliM Thanks for reporting this issue.

It looks like it's coming from Azure .NET SDK, since the only place where System.Memory.Data is directly referenced in Semantic Kernel is a unit test project (which I think we can remove at some point).

I also found a similar issue here: Azure/azure-sdk-for-net#47467

Could you please try to use these package versions and see if that works for you?

  • Azure.Storage.Blobs 12.22.0
  • Azure.Storage.Common 12.21.0
  • Azure.Storage.Queues 12.20.0
  • Azure.KeyVaults.Secrets 4.6.0

Thank you!

@dmytrostruk
Copy link
Member

@MuraliM I created a PR to remove System.Memory.Data direct dependency from SK solution (#9970), but as I mentioned in previous comment, I think the issue is occurring on Azure .NET SDK side.

I'm going to close this issue, for more information please see my previous comment. Thanks!

@dmytrostruk dmytrostruk moved this from Sprint: In Progress to Sprint: Done in Semantic Kernel Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: Done
Development

No branches or pull requests

5 participants