Skip to content

Bug: OllamaSharp is not StrongName signed and won't work for (.Net Framework target SDKs) #8928

@gjactat

Description

@gjactat

Since the "OllamaSharp" dependency does not have a strong name, "Microsoft.SemanticKernel.Connectors.Ollama" won't load it when targetting .Net Framework SDKs.

Those strong name issues do not apply to .net core though.

Related issue:

The following error occurs when trying to instantiate "OllamaTextEmbeddingGenerationService" in a .net 4.7.2 project.

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'OllamaSharp, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
   at Microsoft.SemanticKernel.Connectors.Ollama.Core.ServiceBase..ctor(String model, Uri endpoint, HttpClient httpClient, ILoggerFactory loggerFactory)
   at Microsoft.SemanticKernel.Connectors.Ollama.OllamaTextEmbeddingGenerationService..ctor(String modelId, Uri endpoint, ILoggerFactory loggerFactory)
   at OllamaStrongNameIssue.Program.Main(String[] args)

Steps to reproduce the behavior:

  1. Create a .net 4.7.2 console project
  2. Add the "Microsoft.SemanticKernel.Connectors.Ollama" nuget package (currently v1.20.0-alpha)
  3. Add the following code in the main function :
var service = new OllamaTextEmbeddingGenerationService("fake-model", new Uri("http://localhost:11434/", UriKind.Absolute));
  1. Run the program

Platform

  • OS: Windows 11 Pro
  • IDE: Visual Studio 2022 v17.11.4
  • Language: C#

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codeblockedThis issue is blocked from making progressbugSomething isn't working

Type

No type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions