gpt4 book ai didi

entity-framework - 您的启动项目 'project' 未引用 Microsoft.EntityFrameworkCore.Design

转载 作者:行者123 更新时间:2023-12-04 08:36:14 25 4
gpt4 key购买 nike

我正在使用 EntityFrameworkCore 版本 2.2.2 构建 WPF 应用程序

然而,当我想Add-Migration它向我输出一个错误...
Your startup project 'project' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.
我不知道为什么会发生这种情况,因为我可以在出现此错误之前使用它。

这是我的 packages.config文件

<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="3.3.2" targetFramework="net461" />
<package id="Fody" version="4.0.2" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="net461" />
<package id="Microsoft.Data.Sqlite.Core" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Abstractions" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Analyzers" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Design" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Relational" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Sqlite" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Sqlite.Core" version="2.2.2" targetFramework="net461" />
<package id="Microsoft.EntityFrameworkCore.Tools" version="2.2.2" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Caching.Memory" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Configuration.Binder" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.DependencyInjection" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Logging" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net461" />
<package id="Microsoft.Extensions.Primitives" version="2.2.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="Remotion.Linq" version="2.2.0" targetFramework="net461" />
<package id="SQLitePCLRaw.bundle_green" version="1.1.12" targetFramework="net461" />
<package id="SQLitePCLRaw.core" version="1.1.12" targetFramework="net461" />
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.12" targetFramework="net461" />
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.12" targetFramework="net461" />
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.12" targetFramework="net461" />
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.12" targetFramework="net461" />
<package id="System.Buffers" version="4.4.0" targetFramework="net461" />
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net461" />
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net461" />
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net461" />
<package id="System.Interactive.Async" version="3.2.0" targetFramework="net461" />
<package id="System.Memory" version="4.5.1" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.1" targetFramework="net461" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net461" />
</packages>

该软件包已安装。

NuGet Package Manager

非常感谢任何帮助。

最佳答案

Add-Migration由于您使用 Costura 嵌入程序集,因此可能会感到困惑。尝试删除 costura 以查看是否可以解决问题。

关于entity-framework - 您的启动项目 'project' 未引用 Microsoft.EntityFrameworkCore.Design,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54799905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com