从网络共享注册包布局Registering a package layout from a network share

由于需要复制程序包、存储库、生成文件夹等,协作式和多设备开发可能非常耗时。如果你是在 Windows 10 版本 1709 及更高版本上开发,则可以利用某个功能将程序包布局生成为一个网络共享,然后直接通过网络在远程设备上注册该布局。Collaborative and multi-device development can be time consuming due to the need to copy packages, repositories, build folders etc. If you're developing on Windows 10 version 1709 and later you can take advantage of a feature to build your package layout to a network share and then register the layout on a remote device directly from the network.

多人可以参与网络共享上的单个应用程序包布局,其他协作者和注册了该应用程序的用户将可以看到更改。Multiple people can contribute to a single app package layout on a network share and changes will be visible to other collaborators and users who registered the app. 如果要为多个设备生成应用,可以利用此功能,并避免将应用复制到每个设备进行测试。If you are building an app for multiple devices you can take advantage of the feature and avoid having to copy the app to each device for testing.

必备条件Prerequisites

  1. 你的设备必须运行 Windows 10 创意者更新预览体验内部版本 14965 或更高版本。Your devices must be on Windows 10 Creators Update Insider Build 14965 or later.

  2. 你需要在所有设备上启用开发者模式和设备发现。You will need to enable developer mode and device discovery on all devices.

  3. 协作者需要对生成文件夹具有读取和写入访问权限。Collaborators will need read and write access to the build folder.

  4. 用户只需要对生成文件夹具有读取访问权限。Users will only need to read access to the build folder.

在 Visual Studio 中In Visual Studio

如果是在 Visual Studio 中进行开发,则可以按照此处所述步骤进行操作。If you are developing in Visual Studio you can follow the steps outlined here.

从命令行中From the command line

如果不是在 Visual Studio 中进行开发,并且使用命令行工具,则可以使用 WinDeployAppCmdIf you are not developing in Visual Studio, and using command line tools you can use WinDeployAppCmd. 下面是有关如何在命令行窗口中执行此操作的示例:Below is an example of how to do so from a command line window:

WinAppDeployCmd.exe registerfiles -remotedeploydir <network path> -ip <IP Address> -pin <target machine PIN>
  • 网络路径 – 应用的松散文件的路径Network Path – Path to the app’s loose files

  • IP 地址 – 在此处输入目标计算机的 IP 地址P Address – enter the IP Address of the target machine here

  • PIN - 与目标设备建立连接时所需的 PIN。Pin - A pin if it is required to establish a connection with the target device. (如果需要身份验证,将提示你使用 -pin 选项重试。)单击此处以了解如何获取 PIN。(You will be prompted to retry with the -pin option if authentication is required.) Click here to learn how to get a PIN.

你还可以构建一个完全打包的应用程序,用于在测试和验证期间访问网络共享中的文件。You can also build a fully packaged application that accesses files in a network share during testing and validation. 有关示例,请参阅此示例。See this sample for an example.