简体   繁体   English

如何使用通过Visual Studio 2015发布的OneClick发布.NET应用程序?

[英]How do I publish a .NET application with OneClick publish through Visual Studio 2015?

I've been trying to research this the last couple of days and it doesn't seem like there is very good support for beginners. 最近几天,我一直在尝试对此进行研究,但似乎对初学者没有很好的支持。 All video tutorials I find don't answer the questions I'm asking. 我发现的所有视频教程都无法回答我所问的问题。

What I want: 我想要的是:

I have an application I've written with .NET 4.6.1 in Visual Studio 2015 and I want to distribute an .exe that automatically checks if there are updates. 我有一个用Visual Studio 2015中的.NET 4.6.1编写的应用程序,我想分发一个.exe,它可以自动检查是否有更新。 It seems like this is exactly what OneClick is intended to do. 看来这正是OneClick打算要做的。

Where I'm at right now: 我现在所在的位置:

I want to publish to a shared drive among multiple people. 我想发布到多人共享的驱动器中。 It seems like I put that file path in the "Publishing Folder Location" which produces Setup.exe, MyApp.application, publish.htm, and Application Files. 似乎我将文件路径放在“发布文件夹位置”中,该位置会生成Setup.exe,MyApp.application,publish.htm和应用程序文件。 When you go to publish.htm there is an install button that downloads Setup.exe. 当您转到publish.htm时,有一个安装按钮可以下载Setup.exe。

Where I'm stuck: 我卡住的地方:

When you download the Setup.exe file onto your local machine and try running it gives an error. 当您将Setup.exe文件下载到本地计算机上并尝试运行它时,会出现错误。 The details say it wasn't able to find the MyApp.application file. 详细信息说它找不到MyApp.application文件。 It seems that file is responsible for knowing what version of MyApp is currently installed on the users machine so that it can be compared to the download location (in my case the shared drive) to see if updates are available. 似乎该文件负责了解用户计算机上当前安装了哪个版本的MyApp,以便可以将其与下载位置(在我的情况下为共享驱动器)进行比较,以查看更新是否可用。

What am I missing? 我想念什么? Do I misunderstand the purpose of OneClick publishing? 我是否误解了OneClick发布的目的? Shouldn't users be able to visit the publish.htm once to get an .exe and that .exe is used to launch my application and look for updates first? 用户是否应该不能访问一次publish.htm来获取一个.exe,而该.exe用于启动我的应用程序并首先查找更新? I really appreciate any insight on this topic! 我非常感谢您对此主题的任何见解!

PS I've read over all the MSDN documentation, but it isn't user friendly to beginners in my opinion. PS我已经阅读了所有MSDN文档,但是我认为对于初学者而言,它对用户并不友好。 Or maybe I'm just slow : ) 也许我只是慢了:)

You understand it exactly right, but when a user navigates to the html page, it downloads multiple files. 您完全正确地理解它,但是当用户导航到html页面时,它将下载多个文件。 The .exe, the .application and other supporting files. .exe,.application和其他支持文件。

You are correct in assuming ClickOnce is what you want. 假设ClickOnce是您想要的是正确的。 What I've found is the .net dependencies are very particular when using click once. 我发现使用单击一次时,.net依赖项非常特殊。 You have to make sure each machine has the correct version of the framework and then they can use the htm site. 您必须确保每台计算机都具有正确版本的框架,然后才能使用htm网站。

What I prefer doing is distributing the .application file to the users machine and just letting them run that. 我更喜欢做的是将.application文件分发到用户计算机,然后让他们运行。 It will check for updates on the server every time it is ran and copy all the necessary decencies to the users Local directory. 每次运行时,它将在服务器上检查更新,并将所有必要的标准复制到用户本地目录中。

You have to direct the users to the .application -File. 您必须将用户定向到.application -File。

That one is responible for versioning (Updating) and executing your Application. 那负责版本控制(更新)和执行您的应用程序。

If you execute the .exe it will look for the .application -file to find the infos about the version, which should be installed/downloaded. 如果执行.exe ,它将查找.application -file来查找有关该版本的信息,该信息应安装/下载。

NOTE 注意

Not all Browsers (in case of internet/intranet-deployment) support ClickOnce. 并非所有浏览器(在Internet / Intranet部署的情况下)都支持ClickOnce。 But there are extensions for almost every browser 但是几乎每个浏览器都有扩展

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM