wpf 使用单击一次部署时的安装问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21423386/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installation issue while using click once deployment
提问by Anees Deen
I have a Wpf application where I want it to deploy over remote servers. Previously I used VS2010, So It would be easy to create setup/ .msi files and deploy over other machines.
我有一个 Wpf 应用程序,我希望它在远程服务器上部署。以前我使用的是 VS2010,所以很容易创建 setup/.msi 文件并部署到其他机器上。
Currently I have VS2012. It doesn't have setup deployment option. Also, I read about clickonce application deployment method to deploy my application.
目前我有VS2012。它没有设置部署选项。此外,我阅读了有关 clickonce 应用程序部署方法来部署我的应用程序的信息。
I tried an approach but It doesn't properly install the application in local itself. The application shortcut launching the application for the first time (rarely second time too). Next time, It throws me exception like
我尝试了一种方法,但它没有在本地本身正确安装应用程序。第一次启动应用程序的应用程序快捷方式(很少第二次)。下一次,它抛出我异常
"Cannot start application". Application cannot be started. Contact the application vendor
Error details are:
错误详情是:
ERROR DETAILS
Following errors were detected during this operation.
* [29-01-2014 11:32:48] System.Deployment.Application.DeploymentException (Activation)
- Activation failed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.IO.FileNotFoundException
- The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
Help me on this?
帮我解决这个问题?
回答by Sheridan
I've had this problem before... I can't tell you what causes it, but you'll be glad to hear that the solution is fairly painless. When you get an error message stating that the 'Application cannot be started. Contact the application vendor.', do the following to fix it:
我以前遇到过这个问题……我无法告诉您是什么原因造成的,但是您会很高兴听到解决方案相当轻松。当您收到一条错误消息,指出 '应用程序无法启动。联系应用程序供应商。',请执行以下操作来修复它:


Delete the application history for that application
删除该应用程序的应用程序历史记录
ClickOnce applications are installed into the following path:
ClickOnce 应用程序安装到以下路径:
C:\Users\username\AppData\Local\Apps\2.0.
C:\Users\username\AppData\Local\Apps\2.0.
Please note that the Appsfolder is hidden by default, so you'll need to show hidden files and foldersin the Windows Explorer Folder Options dialog. In this folder is a folder named Data. This contains the user settings and should notbe deleted.
请注意,Apps默认情况下该文件夹是隐藏的,因此您需要在 Windows 资源管理器文件夹选项对话框中显示隐藏的文件和文件夹。在这个文件夹中有一个名为Data. 这包含了用户设置,应该不会被删除。
Other folders in this folder will contain the application history and shouldbe deleted... these folders have random names like 'AP3HP63D.KQT'. It is important that you view the contents before you delete them.
此文件夹中的其他文件夹将包含应用程序历史记录,应删除...这些文件夹具有随机名称,如“AP3HP63D.KQT”。在删除内容之前查看内容很重要。
Folders inside this next level also have semi random names although they use the first and last few letters of the solution folders that they represent... an example: Midas.Models:
下一级中的文件夹也具有半随机名称,尽管它们使用它们代表的解决方案文件夹的第一个和最后几个字母......例如:Midas.Models:
mida..dels_fd8cb4d036a0621f_0003.0001_none_22d6cc2069472451.
mida..dels_fd8cb4d036a0621f_0003.0001_none_22d6cc2069472451。
So, if you are trying to delete the version download history for your application, please ensure that the inner folders are the correct ones. Having located the correct 'outer folder' (e.g. 'AP3HP63D.KQT'), you can simply delete it and re-download the latest version of the application.
因此,如果您尝试删除应用程序的版本下载历史记录,请确保内部文件夹是正确的。找到正确的“外部文件夹”(例如“AP3HP63D.KQT”)后,您只需将其删除并重新下载最新版本的应用程序即可。

