c# - Visual Studio 2019 发布项目不起作用
问题描述
我想在 Visual Studio 2019(版本:16.9.5)中发布我的 WPF 应用程序。
我在解决方案资源管理器中右键单击该项目,单击Publish
并打开一个新选项卡。该选项卡应显示发布设置,但会无休止地加载。
我尝试使用空白/新控制台应用程序,但我遇到了同样的问题。
发布步骤:教程:使用 Visual Studio 发布 .NET 控制台应用程序
编辑:关于发布者的 Visual Studio 日志:
Microsoft.ServiceHub.Framework.ServiceActivationFailedException: Activating the "Microsoft.Publish.Framework.PublishProfilesService (1.0)" service failed. ---> System.ComponentModel.Composition.ImportCardinalityMismatchException: No exports were found that match the constraint: 
	ContractName	Microsoft.Publish.Framework.Nexus.IPublishProfilesService
	RequiredTypeIdentity	Microsoft.Publish.Framework.Nexus.IPublishProfilesService
 at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
 at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
 at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
 at Microsoft.Publish.Framework.Nexus.PublishProfilesService.<CreateAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.Publish.Framework.VisualStudio.PublishPackage.<<InitializeAsync>b__7_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at System.Threading.Tasks.ValueTask`1.get_Result()
 at Microsoft.VisualStudio.Utilities.ServiceBroker.GlobalBrokeredServiceContainer.ProfferedServiceFactory.<InvokeFactoryAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Utilities.ServiceBroker.GlobalBrokeredServiceContainer.ProfferedServiceFactory.<GetProxyAsync>d__28`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at System.Threading.Tasks.ValueTask`1.get_Result()
 at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
 at Microsoft.VisualStudio.Utilities.ServiceBroker.GlobalBrokeredServiceContainer.View.<GetProxyAsync>d__19`1.MoveNext()
 --- End of inner exception stack trace ---
解决方案
推荐阅读
- kotlin - 在 Kotlin 中退出 onClickListener
- c# - Firebase 主题消息传递中不可预测的服务行为
- r - 将两组列名传递给函数
- linux - 为多台机器保存 docker 配置的 Git 策略
- forms - 将 Pardot 表单处理程序提交给 Pardot 以及自己的服务器
- python - Celery 忽略代理 URL
- python - 根据字典的值获取键
- angular - Angular observable 没有得到初始值
- reactjs - React-Spring useTransition 将我的列表项打乱
- python - 如何将构造函数中的默认值设置为从超类继承的值?