【问题标题】:Migration problems wth Visual Studio 2022Visual Studio 2022 的迁移问题
【发布时间】:2022-06-22 17:18:09
【问题描述】:

最近我的公司将 Visual Studio 从 2019 年升级到 2022 年,但我们也有任务在 .NET Framework 4.5 上维护一个旧项目。我按照Open .net framework 4.5 project in VS 2022. Is there any workaround? 中的说明设法在 VS2022 中打开它但是使用 add-migration 命令(或更新数据库)创建迁移存在问题。我得到错误:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
   at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName)
   at System.Data.Entity.Migrations.AddMigrationCommand.<>c__DisplayClass3.<.ctor>b__1()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)


Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

任何帮助将不胜感激!

【问题讨论】:

    标签: entity-framework migration visual-studio-2022


    【解决方案1】:

    我遇到了同样的问题,将 EntityFramework NuGet-package 从 6.2.0 升级到 6.4.4 为我解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2011-04-25
      • 2017-04-16
      • 2021-12-21
      • 2021-12-23
      • 2022-01-09
      • 2022-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多