Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Clickonce在将dot net 2.0版转换为4.0版时发生升级错误_C#_.net_Vb.net_Clickonce - Fatal编程技术网

C# Clickonce在将dot net 2.0版转换为4.0版时发生升级错误

C# Clickonce在将dot net 2.0版转换为4.0版时发生升级错误,c#,.net,vb.net,clickonce,C#,.net,Vb.net,Clickonce,我的团队在将Clickonce应用程序从dot net 2.0升级到dot net 4.0的过程中遇到了一个问题 此外,我们怀疑这是Clickonce工具链中的错误 核心症状: 在版本之间升级时,单击一次升级错误,一次 使用相同的代码,我可以在本地发布非错误版本,但构建服务器总是生成错误版本 有关验证特定文件清单的记录错误 错误发生后,使用不同的对话框正确地重新运行应用程序升级,不会出现错误。 安装“windows management framework 4.0”后,我的本地计算机现在总是出现

我的团队在将Clickonce应用程序从dot net 2.0升级到dot net 4.0的过程中遇到了一个问题

此外,我们怀疑这是Clickonce工具链中的错误

核心症状:

在版本之间升级时,单击一次升级错误,一次 使用相同的代码,我可以在本地发布非错误版本,但构建服务器总是生成错误版本 有关验证特定文件清单的记录错误 错误发生后,使用不同的对话框正确地重新运行应用程序升级,不会出现错误。 安装“windows management framework 4.0”后,我的本地计算机现在总是出现错误版本 以下是我们最初遇到的场景:

我们的大型企业应用程序有一个使用Microsoft Clickonce发布平台安装和分发的厚客户端

我们有一个3.8.90.24版本,它是.net 2.0

到目前为止,我们的下一个版本是3.8.100.19,它是dotnet4.0

我们在服务器上部署了第一个版本。请注意,此特定场景托管在URL上,但也可以使用文件路径部署

我们已经安装了第一个版本的Clickonce客户端

我们在服务器上部署升级版本,完全删除以前的版本,并替换文件

当Clickonce客户端下次运行时,系统会提示我们按常规和预期进行升级,然后单击“确定”

此时将显示一个错误对话框:

An error occured while trying to check for updates to the application.
Do you want to attempt to reinstall from the original installation location?
[ Yes ] [ No ]
选择“是”重新安装,与手动卸载/重新安装一样正常工作

选择“否”将启动旧客户端。如果随后关闭客户端并再次打开应用程序,则它将正确升级

这是一系列令人困惑的症状

我设置了日志记录并发现以下内容:

从构建服务器发布的文件,在drop文件夹中或稍后由我们的安装程序放置的文件总是错误的。 从IDE中的同一代码发布的本地Clickonce在URL或本地目录中没有错误。 从命令行生成,也没有错误,例如:

msbuild /target:publish /p:PublishUrl=http://[FooApplication]/Clickonce/ /p:PublishDir=C:\inetpub\wwwroot\ClickOnce\
然后,因为我想检查文件哈希,我安装了windows management framework 4.0,使用get FileHash命令获取powershell 4.0,然后重新启动

重新启动后,我发现现在以前工作的发布以及所有新的本地发布都显示了错误。 我遵循这些指南,打开了详细日志记录

ClickOnce部署疑难解答 如何记录clickonce部署错误: 如何为clickonce部署指定详细日志文件 在这里,我发现了一些错误的变化

以下是日志的主要摘录,如果需要,我很乐意提供更多内容:

“prep”安装和该版本的升级从以下平台信息开始:

PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 2.0.50727.5485
System.Deployment.dll       : 2.0.50727.5488 (Win7SP1GDR.050727-5400)
mscorwks.dll            : 2.0.50727.5485 (Win7SP1GDR.050727-5400)
dfshim.dll          : 4.0.41209.0 (Main.041209-0000)
新版本的新安装或升级尝试后第二次运行的安装程序包含以下信息:

PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 4.0.30319.18444
System.Deployment.dll       : 4.0.30319.34244 built by: FX452RTMGDR
clr.dll             : 4.0.30319.18444 built by: FX451RTMGDR
dfdll.dll           : 4.0.30319.34244 built by: FX452RTMGDR
dfshim.dll          : 4.0.41209.0 (Main.041209-0000)
有趣的是,不仅版本信息发生了变化,而且平台的结构也发生了变化

在安装/重新启动之前捕获的原始错误日志中发生了一系列有趣的事件:

原始应用程序将与第一个平台信息一起安装 尝试使用第一个平台信息进行升级 升级失败并出现错误,应用程序关闭。 重新启动应用程序,并使用另一个对话框(第二个平台信息)正确升级 以下是来自不同场景的两个错误:

从“实时安装”文件执行升级:

PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 2.0.50727.5485
System.Deployment.dll       : 2.0.50727.5488 (Win7SP1GDR.050727-5400)
mscorwks.dll            : 2.0.50727.5485 (Win7SP1GDR.050727-5400)
dfshim.dll          : 4.0.41209.0 (Main.041209-0000)

[-SNIP-]

ERROR DETAILS
Following errors were detected during this operation.
* [1/12/2015 2:38:45 PM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
    - Exception occurred loading manifest from file [my.app.namespace].Shared.XmlSerializers.dll: 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.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
        at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
        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.DeploymentManager.SynchronizeCore(Boolean blocking)
    --- Inner Exception ---
    System.Deployment.Application.DeploymentException (InvalidManifest)
    - Cannot load internal manifest from component file.
    - Source: 
    - Stack trace:

[-SNIP-]
(There is nothing listed under the final 'stack trace' line)
从本地IDE发布执行升级:

PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 2.0.50727.5485
System.Deployment.dll       : 2.0.50727.5488 (Win7SP1GDR.050727-5400)
mscorwks.dll            : 2.0.50727.5485 (Win7SP1GDR.050727-5400)
dfshim.dll          : 4.0.41209.0 (Main.041209-0000)

[-SNIP-]

ERROR DETAILS
Following errors were detected during this operation.
* [1/12/2015 3:01:28 PM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
    - Exception occurred loading manifest from file [my.app.namespace.client].Shared.dll: 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.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
        at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
        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.DeploymentManager.SynchronizeCore(Boolean blocking)
    --- Inner Exception ---
    System.Deployment.Application.DeploymentException (InvalidManifest)
    - Cannot load internal manifest from component file.
    - Source: 
    - Stack trace:

[-SNIP-]
请注意,这些是不同的DLL文件!这些对于每个单独的发布都是一致的,不同之处在于完整构建过程的版本与本地IDE发布的版本

目前,据我所知,在dot net 2.0和4.0之间转换时,Clickonce部署在验证清单文件时遇到问题。一旦它转换到使用dotnet4.0工具包,一切又会好起来

这会让我们的用户感到困惑,“否”表示他们暂时运行的是过时的客户端,“是”表示他们丢失了一些本地设置

我胡乱猜测,验证过程中的哈希算法或其他机制发生了变化,升级尝试使用2.0版本,这不是100%兼容

我的任何实际问题:

以前有人遇到过这种情况吗?到目前为止,谷歌一直抵制谷歌搜索,尽管类似的签约问题时不时出现,但这种特定的升级方案让我难以理解

我可以收集哪些可能有用的进一步信息

考虑到我们在多个地点都有以前的版本,而新版本尚未发布,我如何解决或解决这个问题