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

Could not able to compile and build while trying to integrate in .net framework project 4.7.2 #69

Closed
zulfiker opened this issue Jun 7, 2023 · 2 comments

Comments

@zulfiker
Copy link

zulfiker commented Jun 7, 2023

Hello there . Greeting

I have a desktop application in which i am trying to integrate whisper .net library . The project is based on .net framework 4.7.2 and WPF . Visual studio 2019 is used

After adding the project from nugget when i try to add sample code in the project in the following line i get an compilation error .

await foreach (var result in processor.ProcessAsync(fileStream))
           {
               Console.WriteLine($"{result.Start}->{result.End}: {result.Text}");
           }

The error is The type 'IAsyncEnumerable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

after doing some research i found that IAsyncEnumerable is part of .net core sdk . to use it for framework version i need to use Microsoft.Bcl.AsyncInterfaces package . even after installing it the error is still there . i have also .net core installed in the sytem and also tried with chaning c# language version from 7.3 to 8.0 . error is still there

I have successfully build sample project which is based on .net core .

So my question is , is this library .net framework compatible or .net core is must ?

@sandrohanea
Copy link
Owner

Hello @zulfiker ,

NetFramework is supported as shown in: https://github.com/sandrohanea/whisper.net/blob/a6ef6265aa734d796f4cf76a504c5285a87ac839/examples/Simple/Simple.csproj#LL5C3-L5C56

This is supported with netstandard2.0 and as shown here, for this you'll have 2 transient dependencies:

  • Microsoft.Bcl.AsyncInterfaces version 7.0.0
  • System.Memory version 4.5.1

I suspect you are not using the SDK-style of csproj which is automatically resolving transient dependencies, but using the old csproj style where you have to manually reference all the transient dependencies.

For quick fix, just install those 2 as well, but I really recommend you switch to SDK-stlyle csproj (even if keeping net framework for now).

These tools will help you to migrate to SDK-Style: https://github.com/dotnet/try-convert , https://dotnet.microsoft.com/en-us/platform/upgrade-assistant

@sandrohanea
Copy link
Owner

Closing due to inactivity ,netframework 4.7.2 is supported and tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants