.net-core - 无法加载文件或程序集 Microsoft.VisualStudio.DevOps.Contract
问题描述
我首次尝试在 Visual Studio 2019 中发布 .NET Core (3.1) Web 应用程序,但出现错误:
System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.DevOps.Contract, Version=15.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'Microsoft.VisualStudio.DevOps.Contract, Version=15.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.DevOps.Contract, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'Microsoft.VisualStudio.DevOps.Contract, Version=15.3.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 Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.FetchContinuousDeliveryService()
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.InitializeContinuousDelivery()
at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel..ctor(IThreadSwitcher threadSwitcher, IPublishServiceProvider serviceProvider, IVsHierarchy hierarchy, ITelemetryProvider telemetryProvider, IVsWrappersFactory vsWrappersFactory, IReadOnlyList`1 providers, IFeatureManager featureDetectionManager, IProfileController profileController, IDependenciesManagerProvider dependenciesManagerProvider)
at Microsoft.Publish.Framework.Provider.DefaultPublishTabProvider.CreateViewAsync(IVsHierarchy project, IAsyncServiceProvider serviceProvider, CancellationToken cancellationToken)
at Microsoft.Publish.Framework.Provider.PublishProjectDesignerTabProvider.<CreateViewAsync>d__7.MoveNext()
之后在 VS 2019 中发布窗口似乎没有完全拉出。有什么想法吗?
解决方案
我已经找到了这个问题的答案,我把它贴在这里。我重新安装了VS2019。我可能在原始安装期间错过了安装关键组件,例如 Azure,我不确定那个细节。
推荐阅读
- php - Laravel 5.4 - 在 hasMany / hasOne 关系的多个级别上访问日期
- python - “str”对象没有属性“pop”
- python - Python - Pandas - 重新采样问题
- laravel - Laravel ReflectionException:类不存在
- php - 循环遍历 php 代码(带有自定义字段)
- php - PHP:将 MySQL 表导出和导入到 Excel
- angularjs - AngularJS 数据表排序
- autocomplete - 将动态变量传递给 Autocomplete.js 中的 highlightResults
- java - Java、线程和优先级
- javascript - JavaScript:如何在表单提交后检查单选按钮?