locked
Problem with universal apps, shared files not found RRS feed

  • Question

  • Hi!

    I am having some issues with the new Universal Apps, i have an existing project, and i have turnt it into a Universal app (r.click Add Windows Phone 8.1 etc), that worked fine, but when i take files from the orignal project to the shared project they cannot be found when the app runs, just to demonstrate, i copied an image over and tried to display it:

    But, if i put the image in the root of the folder it works...

    There is also a warning message saying:

    Warning 3 The file 'cityscape.png' has the same name in the shared project and the 'WorldClockTimeZones' project. The copy from the 'WorldClockTimeZones' project will be deployed to your app. To remove this warning, rename the file 'cityscape.png' in the shared project or the 'WorldClockTimeZones' project. 0 0

    But this is not true, the image no longer exists in the original project...

    Any ideas?

    Thanks

    Andy

    Tuesday, April 22, 2014 12:29 PM

All replies

  • Can you reproduce this in a minimal sample you can share? When you are copying the image around are you doing so from the Solution Explorer or externally? If the file is listed in the original project but isn't available on disk then the app shouldn't even build.

    I can't reproduce this in a trivial app. I created a blank app, added an img tag with a jpg in my images folder.

    I added a Phone project and that included the Shared project

    I added the images folder to the Shared project

    In the Solution Explorer I copied the jpg to the Shared images folder

    As expected, this showed the Warning you mentioned since the jpg was in both the original and shared projects.

    In the Solution Explorer I deleted the jpg from the original folder.

    The app built and ran correctly.

    Tuesday, April 22, 2014 11:16 PM
    Moderator
  • Hi Rob,

    I too cannot reproduce it in a simple app. Something to add to this, i looked around in the the bin folder, and looked at the .appxrecipe file and there i can see the issue, but why it does it i dont know. 

    <AppxPackagedFile Include="C:\Users\Andrew\Source\Workspaces\World Clock - Time Zones\Universal\WorldClockTimeZones.Shared\images\cityscape.png">
          <PackagePath>cityscape.png</PackagePath>

    As you can see the Inlcude path is:

    ...WorldClockTimeZones.Shared\images\cityscape.png

    but the PackagePath is just:

     cityscape.png

    Wednesday, April 23, 2014 7:38 AM