question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly "System.Interactive.Async"

See original GitHub issue

I’m trying to use scaffolding with aspnet-codegenerator but it fails with the following error message: Could not load file or assembly “System.Interactive.Async”

In my console window i write this command:

D:\855 ASP.NET\CMC\src\CMC>dotnet aspnet-codegenerator -p "D:\855 ASP.NET\CMC\src\CMC" controller -name ProjectController -m Project -dc CMC.Models.CMCContext
Building project ...
Finding the generator 'controller'...
Running the generator 'controller'...
Attempting to compile the application in memory
Attempting to figure out the EntityFramework metadata for the model and DbContext: Project
Could not load file or assembly 'System.Interactive.Async, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. Das System kann die angegebene Datei nicht finden. StackTrace:
   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddQuery(IServiceCollection serviceCollection)
   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddEntityFramework(IServiceCollection serviceCollection)
   at Microsoft.EntityFrameworkCore.Infrastructure.RelationalServiceCollectionExtensions.AddRelational(IServiceCollection services)
   at Microsoft.Extensions.DependencyInjection.SqlServerServiceCollectionExtensions.AddEntityFrameworkSqlServer(IServiceCollection services)
   at CMC.Startup.ConfigureServices(IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
   at Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.EntityFrameworkServices.TryCreateContextUsingAppCode(Type dbContextType, ModelType startupType)
Could not load file or assembly 'System.Interactive.Async, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. Das System kann die angegebene Datei nicht finden.
   at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.<BuildCommandLine>b__6_0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
RunTime 00:00:38.43

If the assembly added with nuget then i also get this error.

My project.json looks like this:

{
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.1.0-*"
    },
    "Microsoft.AspNetCore.Authentication": "1.0.0",
    "Microsoft.AspNetCore.Authorization": "1.1.0-*",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0-*",
    "Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0-*",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-*",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-preview1-final",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.EntityFrameworkCore": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Design": "1.0.1",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0-preview1-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-*",
    "Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-*",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview3-final",
    "System.Interactive.Async": "3.0.0"
  },
  "frameworks": {
    "netcoreapp1.1": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8",
        "portable-net45+win8+wp8+wpa81"
      ]
    }
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "web.config"
    ]
  },
  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },
  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview3-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview3-final",
      "imports": [ "portable-net45+win8+wp8+wpa81" ]
    }
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sfmskywalkercommented, Oct 31, 2017

I’m having this same issue:

image

It makes sense in my case, since something caused the System.Interactive.Async package to be bumped up to v3.1.1.0, while EF Core clearly is looking for 3.0.0.0.

So for me, this fix is to add an assembly binding in app.config like so:

<dependentAssembly>
    <assemblyIdentity name="System.Interactive.Async" publicKeyToken="94bc3704cddfc263" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.0.0" />
</dependentAssembly>
0reactions
Eiloncommented, Jan 11, 2018

Closing because there doesn’t seem to be any further action required on this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EF Core 3.0 - Could not load file System.Interactive.Async · ...
I get this error after upgrade .NET Core 2.2 to .NET Core 3.0 and upgrade all package System.IO.FileNotFoundException: Could not load file ......
Read more >
Visual Studio could not load System.Interactive.Async
1 Answer. I eventually solved the issue. The dll file was corrupted, so I just asked a friend to send me a copy...
Read more >
Could not load file or assembly 'System.Interactive.Async ...
I'm having an issue with client-side streaming in C#. When my client code in a VSIX package tries to call a service that...
Read more >
System.Interactive.Async 6.0.1
Interactive Extensions Async Library used to express queries over asynchronous enumerable sequences.
Read more >
[grpc-io] Could not load file or assembly 'System.Interactive ...
Hi, I'm having an issue with client-side streaming in C#. When my client code in a VSIX package tries to call a service...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found