microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
22k stars 3.28k forks source link

.Net: SemanticKernel package was not working in Winforms .NetFramework. #9755

Open ChidanandMurugaiah opened 2 hours ago

ChidanandMurugaiah commented 2 hours ago

Describe the bug

We are utilizing the Microsoft.SemanticKernel package in a .NET Framework 4.8 Winforms sample to retrieve responses from ChatGPT. However, when invoking kernel.GetRequiredService(), it consistently returns null. As a result, we are unable to use the ChatCompletionService to fetch AI responses. Notably, the same code functions correctly in a .NET80 environment.

To Reproduce Steps to reproduce the behavior:

  1. Run the sample
  2. Click Initialize button

Expected behavior Sample needs to be run properly without exception.

Screenshots Image

Sample Link - SemanticKernel (2).zip

Platform

Additional context We saw that this package was compatible for WPF .NetFramework.

RogerBarreto commented 2 hours ago

@ChidanandMurugaiah, can you check if this works with our latest version? 1.29

Please provide more details about the stack trace you getting.

We had a bug 1 month ago related to Null reference exception when using function calling and can be related to your example