安装.net 4.8后,Clickonce应用程序无法启动

问题描述 投票:0回答:1

首先简单:我有一个.net 4.7.2 clickonce winform应用程序,该应用程序在安装.net 4.8(Windows Updates附带)后不会启动。如果您卸载.net 4.8,则一切正常。当您单击开始菜单中的.appref.ms快捷方式时,会启动检查新版本的操作,然后死掉。因此,我检查了事件日志,并显示了以下内容:

System.Configuration.ConfigurationErrorsException
   at System.Configuration.BaseConfigurationRecord.EvaluateOne(System.String[], System.Configuration.SectionInput, Boolean, System.Configuration.FactoryRecord, System.Configuration.SectionRecord, System.Object)
   at System.Configuration.BaseConfigurationRecord.Evaluate(System.Configuration.FactoryRecord, System.Configuration.SectionRecord, System.Object, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(System.String, Boolean, Boolean, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(System.String, Boolean, Boolean, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(System.String, Boolean, Boolean, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
   at System.Configuration.BaseConfigurationRecord.GetSection(System.String)
   at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
   at System.Configuration.ConfigurationManager.GetSection(System.String)
   at System.ServiceModel.Activation.AspNetEnvironment.GetConfigurationSection(System.String)
   at System.ServiceModel.Configuration.ConfigurationHelpers.GetAssociatedSection(System.Configuration.ContextInformation, System.String)
   at System.ServiceModel.Configuration.ConfigurationHelpers.GetAssociatedBindingCollectionElement(System.Configuration.ContextInformation, System.String)
   at System.ServiceModel.BasicHttpsBinding.ApplyConfiguration(System.String)
   at xx.xx.xx.xx.WinClient.Initialize.Execute()
   at xx.xx.xx.Bootstrapper.Bootstrapper+<>c.<Run>b__0_4(xx.xx.xx.Bootstrapper.IBootstrapperCommand)
   at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ForEach(System.Action`1<System.__Canon>)
   at xx.xx.xx.Bootstrapper.Bootstrapper.Run()
   at xx.xx.xx.xx.WinClient.Program.Main()

这看起来很熟悉,因为我确实使用BasicHttpsBinding作为SAP Webservice参考。因此,我想调试代码,以便找到有关安装最新.net版本时这些BasicHttpsBindings为什么不起作用的更多详细信息。不幸的是,在调试应用程序时,它可以正常工作。更糟糕的是...当我直接在<user>/app文件夹中启动.exe文件时,它也可以工作。唯一不起作用的时间是当我使用.appref-ms快捷方式启动应用程序并且-显然-已安装.net 4.8时。

还有其他人在.net 4.8中遇到此问题,并且可以将我引向正确的路径吗?

c# clickonce .net-4.8
1个回答
0
投票

@@ Schadensbergenzer感谢您的举报。这听起来像是一个最近的问题,随着.NET Framework 4.8修补程序的十月份发行,该问题影响clickonce应用程序。您可以尝试将以下内容添加到您的应用配置文件中吗?

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>   
   <runtime>     
       <AppContextSwitchOverrides value="Switch.System.Reflection.DoNotForceOrderOfConstructors=true"/>   
    </runtime> 
</configuration>  
© www.soinside.com 2019 - 2024. All rights reserved.