c# - ClickOnce 格式不正确
问题描述
错误信息:
无法继续。应用程序格式不正确。请联系应用程序发布者寻求帮助。
没有其他显示。“详细信息按钮”已禁用。
启用 ClickOnce 日志记录时未创建日志(也可能是我做错了)
我已经尝试了一些我找到的解决方案。甚至尝试完全重建整个项目(因为我从 Nuget "packages.config" 更改为 PackageReference)
有没有人有任何想法,如何解决这个问题?
更新 尝试在另一台 PC (Win7) 上安装时显示此错误消息:
INFO ZUR PLATTFORMVERSION
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.7.3190.0 built by: NET472REL1LAST_C
clr.dll : 4.7.3190.0 built by: NET472REL1LAST_C
dfdll.dll : 4.7.3190.0 built by: NET472REL1LAST_C
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
QUELLEN
Bereitstellungs-URL: file:///D:/Users/.../Desktop/....dsac
Bereitstellungsanbieter-URL: https://raw.githubusercontent.com/Drachenhorn-Team/Drachenhorn/publish/Drachenhorn.Desktop.application
FEHLERZUSAMMENFASSUNG
Es folgt eine Zusammenfassung der Fehler. Details zu diesen Fehlern werden später im Protokoll aufgelistet.
* Die Aktivierung von D:\Users\Daniel Nietfeld\Desktop\Günther.dsac führte zu einer Ausnahme. Folgende Fehlermeldungen wurden entdeckt:
+ Ausnahme beim Lesen des Manifests aus 'https://raw.githubusercontent.com/Drachenhorn-Team/Drachenhorn/publish/Application%20Files/Drachenhorn.Desktop_0_0_10_42/Drachenhorn.Desktop.exe.manifest': Das Manifest ist möglicherweise ungültig, oder die Datei konnte nicht geöffnet werden.
+ Das Analysieren und die DOM-Erstellung des Manifestes führten zu einem Fehler. Folgende Fehler wurden beim Analysieren protokolliert:
-HRESULT: 0x80070c81
Anfangszeile: 0
Anfangsspalte: 0
Hostdatei:
+ Ausnahme von HRESULT: 0x80070C81
FEHLERZUSAMMENFASSUNG FÜR DIE SPEICHERTRANSAKTION DER KOMPONENTE
Es wurde kein Transaktionsfehler festgestellt.
WARNUNGEN
* Das Manifest für diese Anwendung enthält keine Signatur. Signaturüberprüfung wird ignoriert.
FORTSCHRITTSSTATUS DES VORGANGS
* [16.10.2018 17:27:28] : Die Aktivierung von D:\Users\...\Desktop\....dsac wurde gestartet.
* [16.10.2018 17:27:28] : Erforderliche Überprüfung auf Updates wird so ausgeführt, wie dies durch die Bereitstellung angegeben ist.
* [16.10.2018 17:27:35] : Neue Aktualisierung wird verwendet
* [16.10.2018 17:27:36] : Die Installation der Anwendung wurde gestartet.
FEHLERDETAILS
Folgende Fehler wurden bei diesem Vorgang entdeckt.
* [16.10.2018 17:27:40] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Ausnahme beim Lesen des Manifests aus 'https://raw.githubusercontent.com/Drachenhorn-Team/Drachenhorn/publish/Application%20Files/Drachenhorn.Desktop_0_0_10_42/Drachenhorn.Desktop.exe.manifest': Das Manifest ist möglicherweise ungültig, oder die Datei konnte nicht geöffnet werden.
- Quelle: System.Deployment
- Stapelüberwachung:
bei System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
bei System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
bei System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
bei System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
bei System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState& subState, ActivationDescription actDesc)
bei System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState& subState, String& errorPageUrl)
bei System.Deployment.Application.ApplicationActivator.ProcessOrFollowExtension(Uri associatedFile, String textualSubId, String deploymentProviderUrlFromExtension, String& errorPageUrl, TempFile& deployFile)
bei System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
bei System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
bei System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Interne Ausnahme ---
System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Das Analysieren und die DOM-Erstellung des Manifestes führten zu einem Fehler. Folgende Fehler wurden beim Analysieren protokolliert:
-HRESULT: 0x80070c81
Anfangszeile: 0
Anfangsspalte: 0
Hostdatei:
- Quelle: System.Deployment
- Stapelüberwachung:
bei System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
bei System.Deployment.Application.Manifest.AssemblyManifest..ctor(FileStream fileStream)
bei System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
--- Interne Ausnahme ---
System.Runtime.InteropServices.COMException
- Ausnahme von HRESULT: 0x80070C81
- Quelle: System.Deployment
- Stapelüberwachung:
bei System.Deployment.Internal.Isolation.IsolationInterop.CreateCMSFromXml(Byte[] buffer, UInt32 bufferSize, IManifestParseErrorCallback Callback, Guid& riid)
bei System.Deployment.Application.Manifest.AssemblyManifest.LoadCMSFromStream(Stream stream)
DETAILS ZUR SPEICHERTRANSAKTION DER KOMPONENTE
Es sind keine Transaktionsinformationen verfügbar.
解决方案
我调查了你的情况,我可以说你的问题出在主机服务上。因为它给出了错误的 MIME Content-Type。
这是您的响应 http 标头:
如您所见,您没有来自请求的任何内容类型,因此浏览器以文本形式开始下载文件,这是一种奇怪的行为,因为我总是有下载文件弹出消息。但这里只是屏幕上的原始文本。
这是来自具有正确标头的工作企业应用程序服务器的正确响应:
您可以在此处查看服务器设置详细信息:ClickOnce 部署的 MIME 类型
我希望它对你有用。
推荐阅读
- haskell - 我在 Haskell 中收到错误 Not in Scope 错误
- angular - 制作打字稿参数keyof K和typeof FormGroup
- r - 如何观察闪亮的网址
- javascript - 每个数组元素的独立 HTTP 状态
- python - 如何在python中组合多个except语句
- javascript - 无法在反应应用程序中使用 chartjs 显示圆环图
- javascript - JSON.stringify() 在req.body 中返回object Object
- javascript - 反应视频播放器不在打字稿上播放本地视频
- python - 如何在 django 中一次创建两个模型
- powershell - powershell:将加密的用户密码保存在文件中以进行比较