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

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

Closed
gjactat opened this issue Sep 20, 2024 · 1 comment · Fixed by #9091
Closed
Assignees
Labels
blocked This issue is blocked from making progress bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@gjactat
Copy link

gjactat commented Sep 20, 2024

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#
@gjactat gjactat added the bug Something isn't working label Sep 20, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Sep 20, 2024
@github-actions github-actions bot changed the title Bug: .Net: Bug: Sep 20, 2024
@gjactat gjactat changed the title .Net: Bug: Bug: Can't instantiate OllamaTextEmbeddingGenerationService (Net Framework 4.7.2) Sep 20, 2024
@gjactat gjactat changed the title Bug: Can't instantiate OllamaTextEmbeddingGenerationService (Net Framework 4.7.2) Bug: Can't instantiate OllamaTextEmbeddingGenerationService (.Net Framework 4.7.2) Sep 20, 2024
@RogerBarreto RogerBarreto changed the title Bug: Can't instantiate OllamaTextEmbeddingGenerationService (.Net Framework 4.7.2) Bug: OllamaSharp is not StrongName signed and won't work for (.Net Framework target SDKs) Sep 30, 2024
@RogerBarreto RogerBarreto added the blocked This issue is blocked from making progress label Sep 30, 2024
@awaescher
Copy link

OllamaSharp 3.0.10 now comes with a strong name ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked from making progress bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants