6

我使用Parallels在虛擬機上模擬Windows 8。爲了簡化和一致性,我將所有開發人員項目存儲在Mac分區中。Visual Studio 2012網絡共享

當我嘗試建立一個應用程序(的Visual Studio 2012)流失這個網絡共享,我得到以下編譯時錯誤:

Error 1 Error : DEP0700 : Registration of the app failed. Rejecting a request to register from file:///Z:/Users/MY_USER_NAME/Sites/App1/App1/bin/Debug/AppX/AppxManifest.xml because the files are on a network share. Copy the files to the local computer before registering the package. (0x80073cf9) App1

有誰知道如何解決這個問題呢?我需要告訴Visual Studio 2012我的網絡共享是一個可信的設備,或者至少讓它認爲項目在本地驅動器中。無論如何要在Windows中創建符號鏈接?

在Visual Studio 2010中,我解決了這個問題,因爲概述本網站上:http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/

感謝您的幫助!

+0

做同樣不是VS 2012的工作? – spender

+1

您的milage將根據您開發的應用類型而有所不同。就我而言,我正在開發一個Windows 8 metro應用程序。編譯應用程序時,Windows會對該應用程序進行簽名,並允許其隱式安裝。由於安全問題,如果您正在運行網絡共享,則這不起作用。如果您有任何疑慮,請查看我在下面發佈的鏈接。快速解決方案是告訴Windows您正在運行應用程序。遠程。 – Alex

+0

簡單的答案在http://stackoverflow.com/questions/12126918/registration-of-app-failed-because-the-files-are-on-a-network-share-copy-the-fi。確認在VS2017工作。 –

回答

14

This post by Gearard Boland解決了這個問題。希望這個就派上用場了爲別人開發了一個網絡共享:

Yes, it's by design that you cannot run a Metro app from a network drive and deployment from Visual Studio essentially registers the app with the system without actually packaging and installing it (so it doesn't get put into the normal install location, which is local).

You can still work with sources on a network drive, but you'll have to override the deployment location, which by default is under the project's root directory (e.g. bin\). You have several options:

  1. You can switch from local debugging to remote debugging and set the machine name as 'localhost'. This will do a remote deployment on your local machine (thus not using the project's directory). You don't need to install the Remote Debugger tools, nor start msvsmon for this to work on localhost.
  2. You can override the project's output directory. Right-click on the project and change the output directory to something like: $(Temp)\$(MSBuildProjectName)\bin\$(Configuration) , where Temp is an environment variable pointing to your Temp directory.
  3. If you still want normal output to live next to the sources, e.g. when you build the appx package, etc., you can override only the layout directory instead of the entire output path. For this you'll need to modify your project file directly (e.g. *.jsproj, *.csproj, ...) to add the new value:

    <PropertyGroup> 
        <LayoutDir>C:\WorkingFolder\$(MSBuildProjectName)\$(Configuration)</LayoutDir> 
    </PropertyGroup> 
    

Hope that helps.