【发布时间】:2018-08-31 19:52:33
【问题描述】:
我正在尝试使用 SQL Operations Studio 从 VS 代码的终端生成数据库,每当我尝试生成迁移时,都会出现此错误。
dotnet ef migrations add init
未处理的异常:System.IO.FileLoadException:无法加载文件或程序集'/usr/local/share/dotnet/sdk/2.1.401/DotnetTools/dotnet-ef/2.1.2/tools/netcoreapp2.1/任何/工具/netcoreapp2.0/any/ef.dll'。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)
这就是我的.csproj 现在的样子
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.2" />
</ItemGroup>
</Project>
有什么解决方法吗?
【问题讨论】:
-
你有.core 2.1.2 框架吗?
-
@viveknuna 是的,我有。
-
我认为你可以在 EF Core 中提出错误
-
我解决了在
<RuntimeIdentifier>osx.10.12-x64</RuntimeIdentifier>标签内添加<RuntimeIdentifier>osx.10.12-x64</RuntimeIdentifier>的问题
标签: c# .net-core entity-framework-core