gpt4 book ai didi

c# - 在 ClickOnce Publish 上退出 list 后无法识别 .exe 文件

转载 作者:行者123 更新时间:2023-11-30 16:41:20 24 4
gpt4 key购买 nike

我正在使用 MVS 2015 和 .Net Framework 4.5。我发布了我的 C# WF 应用程序,一切正常,但我必须混淆应用程序文件中的 .exe。在我这样做之后,显然,安装程序不再识别 .exe,哈希值不同等等。

我使用提供必要的 .pfx 和密码的 Signtool 退出新的 .exe 添加文件,然后我使用 Mage 更新 .manifest 和 .application according to the second part of this MSDN documentation .

一切都成功了,但是当我运行安装程序并点击安装时,过了一会儿(大约 80% 的安装进度)我收到一条错误消息,指出新的 .exe 文件有问题:

PLATFORM VERSION INFO
Windows : 10.0.16299.0 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.7.2556.0 built by: NET471REL1
clr.dll : 4.7.2633.0 built by: NET471REL1LAST_C
dfdll.dll : 4.7.2556.0 built by: NET471REL1
dfshim.dll : 10.0.16299.15 (WinBuild.160101.0800)

SOURCES
Deployment url : file:///E:/share/myApp.application
Application url : file:///E:/share/myApp.exe.manifest

IDENTITIES
Deployment Identity : myApp.exe.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil
Application Identity : myApp.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil, type=win32

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of E:\share\myApp.application resulted in exception. Following failure messages were detected:
+ Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
+ Cannot load internal manifest from component file.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [24.03.2018 11:03:32] : Activation of E:\share\myApp.application has started.
* [24.03.2018 11:03:32] : Processing of deployment manifest has successfully completed.
* [24.03.2018 11:03:32] : Installation of the application has started.
* [24.03.2018 11:03:33] : Processing of application manifest has successfully completed.
* [24.03.2018 11:03:35] : Found compatible runtime version 4.0.30319.
* [24.03.2018 11:03:35] : Request of trust and detection of platform is complete.

ERROR DETAILS
Following errors were detected during this operation.
* [24.03.2018 11:03:43] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
- Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)

我做错了什么?我错过了什么? :(

最佳答案

我已经调查了 Marko 应用程序,如果您在使用 .NET Refactor 并且遇到上面的问题,这里是让它工作的解决方法:

无论如何,如果您要在发布后修改您的程序集,您无论如何都需要重新计算散列。这怎么可能:

  1. 不要使用 Visual Studio 发布引擎生成你通过“mage.exe”申请。它让你准备你的来源首先应用程序,然后创建 ClickOnce 应用程序。
  2. 从第二个下载链接下载实用程序 [here] .执行并 [选择] 您的文件夹 > 将操作更改为 [更新] > 和 [构建]。无需更多操作。更新操作将重新计算哈希值。
  3. 如果您的混淆器软件支持命令行参数,那么您可以在 .exe VS 项目属性中添加“构建后事件”脚本,它将在 clickonce 构建之前执行。

您可以在此处找到“部署混淆程序集”一文:Securing ClickOnce Applications

关于c# - 在 ClickOnce Publish 上退出 list 后无法识别 .exe 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49422530/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com