63

I can not use the SqlType provider due to an issue with Microsoft.Bcl.AsyncInterfaces.
I am using a minimal program with .NET 4.7.2 and F# 4.7.0.0. My Nuget packages contain a reference to:

package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net472"

Severity Code Description Project File Line Suppression State Error FS3033 The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. Details: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Das System kann die angegebene Datei nicht finden. TestSqlProvider C:\Users\weism\source\repos\TestSqlProvider\TestSqlProvider\Program.fs 9 Active

What can I do to fix this issue?

asked Sep 27, 2019 at 12:50
3
  • 2
    The English translation of "Das System kann die angegebene Datei nicht finden" is "The system cannot find the file specified". Commented Sep 27, 2019 at 15:56
  • Are you using .net core? If so does the command dotnet restore fix anything? Commented Sep 28, 2019 at 20:01
  • If it's still an issue, can you post csproj of this app? Commented Feb 21, 2020 at 20:48

13 Answers 13

56

For me, installing the Microsoft.Bcl.AsyncInterfaces (Nuget package) fixed the issue.

answered Jan 28, 2021 at 8:42
2
  • 1
    Just the right Answer, Installing this to the project which when compiled and ran gives the problem, solves it :) Commented Oct 3, 2021 at 15:54
  • you're life saver =)) Commented Jun 20, 2024 at 10:28
16

I don't use Microsoft.Bcl.AsyncInterfaces at all in my .NET 4.8 project. Some library depends on version 1.0.0.0. I resolved the issue using a binding redirect:

<dependentAssembly>
 <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
 <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>

Microsoft.Bcl.AsyncInterfaces.dll 5 was copied to Bin after build.

Petter Hesselberg
5,5883 gold badges28 silver badges51 bronze badges
answered Feb 15, 2021 at 6:49
1
  • I needed this for XrmToolbox. Except I had to bind for Version 7.0.0.0 Commented Dec 12, 2023 at 16:57
14

This error also happens when you try using Microsoft.EntityFrameworkCore v5 in a dotnet core v3.1 project. To resolve, down-version Microsoft.EntityFrameworkCore to latest v3 version.

answered Jun 5, 2021 at 15:29
2
  • 3
    Or upgrade .NET Core to v5. =) Commented Aug 18, 2021 at 18:54
  • This worked for me.. after clearing all nuget cache from package manager setting Commented Sep 25, 2021 at 16:46
13

For .Net Core, This problem basically occurs, when we use layered architecture. Just make sure the version of Microsoft.EntityFrameworkCore should be same in all project, wherever it is used.

fat
7,2237 gold badges48 silver badges73 bronze badges
answered Feb 18, 2021 at 23:14
1
  • In my case was almost that. I had installed Microsoft.EntityFrameworkCore.InMemory version 5.0.7 which depends on Microsoft.EntityFrameworkCore. So, as you mentioned, as soon as all the projects had the same version the issue was solved. Commented Jun 25, 2021 at 12:33
3

I think you update package in one layer. for me i worked in project with three layers (api, AdminTool, Data) the AdminTool Layer had a reference to Data Layer i updated all packages in AdminTool only so i had this error i update package also in data layer and api layer so the problem solved. I hope that help you.

answered Mar 22, 2020 at 16:12
1

I was able to fix it by removing <Private>True</Private> from csproj for Microsoft.Bcl.AsyncInterfaces. Just reinstall this NuGet package

answered Feb 2, 2023 at 13:49
0

Make sure you have unique single version of that dll. Another step would be to add a binding redirect in the app.config as told in the above comments.

answered Jul 15, 2021 at 12:52
0

Check in your installed nuget packages--- If version of Microsoft.EntityFrameworkCore and your .net project is different then it can be a problem. Example - If EntityFrameworkCore is at v5.1.5 or higher & your project dotnet core v3.1 project, this can be the issue.

To solve,

  1. down-version Microsoft.EntityFrameworkCore to equal version of project such as v3 version. to down version click on tool in visual studio -->Nuget Package Manager--> Manage Nuget package for Solutions --> click on installed ---> select nuget package which you want to downgrade --> click on uninstall and then select the same nuget package and then install version 3.1.5 or relevent package.

or

  1. Install Microsoft.Bcl.AsyncInterfaces (Nuget package)
answered Aug 8, 2021 at 4:49
0

Updating the Microsoft.Bcl.AsyncInterfaces assembly via NuGet did everything it needed to do, including adding the bindingRedirect entries in the appropriate config files.

I also did all the other hygienics. I cleaned my solution, deleted the bin and obj directory entries, and also cleaned my localhost deploy locations.

However, I still got this error. I reviewed the output (my application is a .NET 4.8 MVC Web application, so the web page showed the error log in detail), and I found that it was failing on loading SimpleInjector.

I updated SimpleInjector to the latest version via NuGet and that fixed my error.

Unfortunately, I didn't keep a copy of the error page, so I can't show you what I saw, but the bottom line is to examine the output or log in detail, see if you can find where the application is attempting to load the assembly that is failing, and update that assembly that appears to be calling the load.

answered Oct 25, 2022 at 12:08
0

I had to restart my production server, which is also my web server for several websites, among other things. After the restart, I now have a new, different error Error NU1301: Unable to load the service index for source... What a nightmare NuGet package management is.

answered Aug 3, 2023 at 19:47
0

I had the similar issue. For me, it was working fine on local, but on the server(dev or QA), it was failing. My project has two solutions - One for Web and the other one is for DB Access. I resolved this issue in below ways.

  1. Found out that there is a discrepancy of Microsoft.Bcl.AsyncInterfaces - Web solution was having 5.0.0 whereas DB Access solution had 6.0.0 . I upgraded Web Solution's BCL package to 6.0.0
  2. Found that below dependentAssembly was missing from web.dev and web.qa config files even after installation of BCL interface 6.0.0 nuget package. I manually added this in both config files and it fixed the issue.

BCLInterface

Spent a good amount of time as the error was misleading and it says that the version it is looking for is 'Version=1.0.0.0'. Hope this helps. Thanks.

answered Apr 2, 2024 at 18:40
0
0

After uprgrade to Net 8 i got this issue. Solved by installing Microsoft.Bcl.AsyncInterfaces 8.0.0

answered Apr 18, 2024 at 11:15
0

My Entity Framework Core just needed upgraded.

<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.10" /> TO <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" />

General Grievance
5,08239 gold badges39 silver badges58 bronze badges
answered Feb 5, 2021 at 18:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.