Fails to load dependencies

Fails to load dependencies

Anonymous
Not applicable
2,743 Views
2 Replies
Message 1 of 3

Fails to load dependencies

Anonymous
Not applicable

I am using Revit 2019 and I have a plugin that is supposed to use EntityFramework to read/write to a database. I have a class called LifeSciencesContext that extends DbContext. As soon as the constructor for LifeSciencesContext (which calls the base constructor) gets hit, I get the exception below.

In my project I have a reference to System.Interactive.Async v3.2.0.0.

In app.config I have the line "<bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />"

I also believe that this is something that has to do with Revit as opposed to anything else because I created a standalone project that bypasses Revit entirely, and this exception does not occur in that situation.

 

Has anyone else come across anything like this and fixed it? I've tried all the things mentioned in any forum that is remotely similar to this, but none have worked. Any ideas?

 

Exception mentioned above:

"Could not load file or assembly 'System.Interactive.Async, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' or one of its dependencies. The system cannot find the file specified."

 

Stack Trace:

   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.TryAddCoreServices()
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c__DisplayClass4_0.<GetOrAdd>b__2(Int64 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.EntityFrameworkCore.DbContext.Constructor(DbContextOptions options)
   at BT.Data.LifeSciencesContext.Constructor(String connectionString) in C:\\Views\\Plugins\\LifeSciences\\BT.Data\\LifeSciencesContext.cs:line 48
   at BT.Data.Repo.FacilityRepo.Constructor(String connectionString) in C:\\Views\\Plugins\\LifeSciences\\BT.Data.Repo\\FacilityRepo.cs:line 32

 

 

0 Likes
Accepted solutions (1)
2,744 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

After basically resetting the project and reloading all the references, my exception went away. Not sure why exactly, but I must have had some reference set up wrong, or was including the wrong version of a reference.

Message 3 of 3

yafimski
Contributor
Contributor

@Anonymous I have a similar issue.
What do you mean by "resetting the project"? Can you detail the steps you took?

0 Likes