【问题标题】:UNC File System Target Location Publishes Instead to Local FilesystemUNC 文件系统目标位置发布到本地文件系统
【发布时间】:2017-08-01 18:20:14
【问题描述】:

将 UNC 路径指定为 Visual Studio 2015“文件系统”发布方法的目标位置(例如,“\\UNC\Path”)。

但是,Visual Studio 不会发布到 UNC 路径,而是发布到本地驱动器上项目文件夹的子目录。

Visual Studio 输出窗口显示以下输出:

...
1>Web App was published successfully file:///C:/Users/UserName/Source/Workspaces/Project_Main/Project/%E2%80%8B//UNC/Path
    1>
    ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
    ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

Visual Studio 2015 似乎将 UNC 路径转换为上面列出的本地文件路径,其中似乎包含 Unicode 字符 U+200B: ZERO WIDTH SPACE (%E2%80%8B),后跟 UNC 路径。

在 Windows 资源管理器中,我可以导航到本地文件夹,验证 ZERO WIDTH PATH 字符确实显示为具有空白名称的文件夹。

Project 表示一个 ASP.NET MVC 5 Web 应用程序。

如何成功发布到目标位置字段中的 UNC 路径?

【问题讨论】:

    标签: asp.net visual-studio deployment publish


    【解决方案1】:

    似乎从 SharePoint 2013 wiki 表中复制文本引入了前导 Unicode 零宽度路径字符,这反过来似乎使 Visual Studio 误以为 UNC 路径代表本地文件路径。

    我通过以明文形式手动输入 UNC 路径,然后将其复制/粘贴到目标位置解决了这个问题。

    Visual Studio 现在可以正确发布到 UNC 路径。

    垃圾进,垃圾出。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-30
      • 1970-01-01
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 1970-01-01
      • 2019-04-07
      • 2013-07-18
      相关资源
      最近更新 更多