none
Unable to build UWP package for sideloading RRS feed

  • Question

  • Immediately after building a UWP app package for Microsoft Store successfully, I tried to build its package for side-loading without changing anything.   Unfortunately, the build kept failing with the following error:

    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error : System.IO.DirectoryNotFoundException: Could not find a part of the path '...\MyApp\Assets'.
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at System.IO.FileSystemEnumerableIterator`1.CommonInit()
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at Microsoft.Build.AppxPackage.CreateAppInstallerPublishMeta.GetLogoFilePath(AppInstallerInfo appInstallerInfo)
    2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(6235,5): error :    at Microsoft.Build.AppxPackage.CreateAppInstallerPublishMeta.ExecuteImplementation()
    I cleaned the solution and restarted VS to no avail.

    Could anyone offer a tip on its remedy?


    Hong

    Monday, November 4, 2019 9:21 PM

All replies

  • Hi Hong,

    Thank you for posting here.

    Could you just build it successfully when you right-click project -> Build? And as the error, please check if the specified path could be accessed on your side. 

    If possible, can you share the code block where the error locates? Or what is the interface used to access the specified path?

    Look forward to your reply.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Tuesday, November 5, 2019 6:16 AM
  • Thank you for trying to help, Dylan.

    I figure out a way to get around the problem.  The UWP project is a part of a X-platform solution based on Uno.  All platform heads such as UWP reference a shared folder.   The shared folder has an Assets folder with files such as icons. This has been working fine for a long time for all heads with this sideloading package build as the only exception so far.  Based on the error, I created an empty folder Assets under the UWP head, and the sideloading package build succeeded.  This empty Assets folder is like magic. 


    Hong

    Tuesday, November 5, 2019 3:20 PM
  • Hi Hong,

    Thank you for reply.

    According to your details, is the empty folder shared folder? Maybe you could copy the files from shared to local folder, then re-reference it.

    And also, you could try to set lower warning level in Project Properties/Build.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, November 6, 2019 7:50 AM
  • Hello Dylan,

    Sorry for confusing you.   Let me try again.

    The scenario with the build issue:

    MyApp(Shared)

       -Assets

             a.png

             b.png

             c.png

    MyApp(UWP)

    The scenario after the build issue has been solved:

    MyApp(Shared)

       -Assets

             a.png

             b.png

             c.png

    MyApp(UWP)

       -Assets


    Hong

    Wednesday, November 6, 2019 12:45 PM
  • Hi Hong,

    Thank you for details.

    Is the shared same with the UWP, and just lack asset folder? I'm afraid that the reference path is not correct in MyApp(UWP). Please open MyApp(UWP) csproj file with text format, and check the directory. Generally, the directory is a relative path to the current project.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, November 7, 2019 10:06 AM
  • Thank you for the information, Dylan.

    The current setting in MyApp.csproj:

      <ItemGroup>
        <Folder Include="Assets\" />
      </ItemGroup>

    Building of sideloading packages works fine with this setting. 


    Hong

    Thursday, November 7, 2019 3:09 PM
  • Hi Hong,

    Thank you for feedback.

    Usually, the sideloading needs to load the configuration from Package.appxmanifest file. The configuration is about the usage of files for project.

    Not sure why adding the empty folder could solve this issue, could you please share a simple sample which could help us reproduce this issue? It will help us analysis it better. 

    Look forward to your reply.

    Best Regards,

    Dylan 


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, November 8, 2019 7:33 AM