.net ClickOnce .appref-ms 不仅仅是指向 .application 文件的链接?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/281173/
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
ClickOnce .appref-ms more than a link to .application file?
提问by Solracnapod
I have a ClickOnce environment like this:
我有一个像这样的 ClickOnce 环境:
\Fileserver\ClickOnceApps\App1.application
\Fileserver\ClickOnceApps\App1.application
C:\Documents and Settings\user\Start Menu\Programs\publisher\app1.appref-ms
C:\Documents and Settings\user\Start Menu\Programs\publisher\app1.appref-ms
My understanding is the .apppref-ms file is a glorified link to the app.application file. Does it do anything else?
我的理解是 .apppref-ms 文件是 app.application 文件的美化链接。它还有别的作用吗?
回答by Nir
If you open the appref-ms file in a text editor you'll see it contains the Url for the application, culture, processor architecture and key used to sign the application, so yes, it's just a link.
如果您在文本编辑器中打开 appref-ms 文件,您将看到它包含应用程序的 URL、文化、处理器架构和用于签署应用程序的密钥,所以是的,它只是一个链接。
The difference between those "Application Reference" files and shortcuts (.lnk) is that the application reference points to the original application Url and not the location of the exe on disk, when you run the appref-ms file the system knows how to find the copy of the program on the local disk and run it from there without accessing the Url (this is not accurate and depends on settings in the ClickOnce manifest, but its a close approximation).
那些“应用程序引用”文件和快捷方式(.lnk)的区别在于应用程序引用指向原始应用程序Url而不是exe在磁盘上的位置,当您运行appref-ms文件时,系统知道如何找到本地磁盘上的程序副本并从那里运行它而不访问 Url(这不准确,取决于 ClickOnce 清单中的设置,但它是一个近似值)。
回答by Meisterunner
If you open it and then open task manager then right click the task, open file location and it'll take you (most times) directly to the actual .exe
如果您打开它然后打开任务管理器,然后右键单击该任务,打开文件位置,它会(大多数情况下)直接将您带到实际的 .exe

