Sitelet https://github.com/CirrusRedOrg/EntityFrameworkCore.Jet/issues/95
Skip to content

How to scaffold when having x64 and x86 .NET Core SDKs installed #95

Description

@lauxjpn

I am encountering this error when I try to scaffold an existing older version of .mdb (likely Access '97 version)

Could not load assembly 'Legacy.Test.RDBMSMigrations'. Ensure it is referenced by the startup project 'Legacy.Test.RDBMSMigrations'.

In Visual Studio my project is the default startup project and default project on PMC

command I ran via PMC

Scaffold-DbContext -Connection "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\RDBMS\cdb2.mdb;Jet OLEDB:Database Password=mypassword;" -Provider EntityFrameworkCore.Jet -OutputDir CDB2\Models -ContextDir CDB2\Context -Project Legacy.Test.RDBMSMigrations -StartupProject Legacy.Test.RDBMSMigrations

or

Scaffold-DbContext -Connection "Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\RDBMS\cdb2.mdb; Pwd=mypassword;" -Provider EntityFrameworkCore.Jet -OutputDir CDB2\Models -ContextDir CDB2\Context -Project Legacy.Test.RDBMSMigrations -StartupProject Legacy.Test.RDBMSMigrations

Yet same error comes up, also same using the alternate dotnet ef dbcontext scaffold command via CLI

Any idea on what is wrong?

My project setup is as follows

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="EntityFrameworkCore.Jet" Version="3.1.0-alpha.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.10">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="System.Data.Odbc" Version="5.0.0" />
    <PackageReference Include="System.Data.OleDb" Version="5.0.0" />
  </ItemGroup>

</Project>

Originally posted by @olakusibe in #34 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions