locked
Universal App - Windows Store app can't find shared files

    Question

  • I have created a universal app by starting with a working Windows 8 app and converting it using VS2013.  I then moved the js, css and images folders to the shared project.  The Windows Phone app works fine and can use all of the shared files. The Windows 8 app can not find any of the shared files.  The Shared project appears in the references for both the Phone and Store apps.  The intellisense on the default page of the Store app correctly finds the images, css and js files in the shared project.   Any idea what is going on here? 
    Saturday, May 10, 2014 2:33 PM

Answers

  • Yes, I did add the Phone project by right clicking and adding.

    I gave up on trying to get this solution to work.  I created a new blank Universal App solution and added the Windows 8.1 project files manually.  It works as expected now.

    I do still have the "broken" solution.  I will give your suggestion a try when I get some time.

    Thanks for your input

    • Marked as answer by johnGNJ Sunday, August 24, 2014 1:28 PM
    Thursday, May 22, 2014 5:59 PM

All replies

  • Hi johnGNJ,

    You mean the shared project works fine with design mode, but when debug the app, the files are missing?

    I would suggest you to clean up the app package and rebuild the app to see if the problem solved.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, May 12, 2014 8:50 AM
    Moderator
  • I'm not sure what you mean by "clean up the app package".

    This happens while editing the HTML; I create an img tag. When I create the src attribute and start typing the path to an image, the intellisence pops up and has visibility to the image files in the shared project. But when I run the Store app, the image does not display and I get the "broken image" (X in a square) image.  The windows phone app displays the image correctly.  A similar thing happens with js files when creating script tags.

    I overlooked a step in my previous post.  The Store app was originally created using VS2012 and then converted to VS2013 and then to a Universal app. 

    I did the same conversion with the same app on another system and got the exact same results. 

    I have created other Universal apps by converting a Store app that was originally created with VS2013 and they work as expected.

    It appears that is has something to do with the app being created with VS2012 originally.

    Wednesday, May 14, 2014 12:38 AM
  • James, I did a little more digging and experimenting and found that all of the images and js files that are in the shared project and being put into the "bin/Debug/AppX" folder when they should be in the  "bin/Debug/AppX/images" or  "bin/Debug/AppX/js" folder respectively.  So as a test I change the path to the image files by removing the images folder name (<img src="images/background.png" /> change to <img src="background.png" />) and as expected the image appears.  I tried deleting the bin folder to force VS to recreate it. It recreates it in the same way.

    Any idea why this is happening? Any help would be appreciated.

    Thanks,
    John

    Wednesday, May 14, 2014 1:12 AM
  • Did you add the Windows Phone project by right-clicking on the Windows project and selecting "Add Windows Phone 8.1"? If not, you might have some app configuration issues.

    If the Phone project is working correctly, as a workaround you could attempt to manually delete the Windows 8.1 project completely, re-open the project, right-click on the Phone project, and select "Add Windows 8.1". Perhaps that would repair a corruption in the project system configuration.

    Thursday, May 22, 2014 3:43 PM
  • Yes, I did add the Phone project by right clicking and adding.

    I gave up on trying to get this solution to work.  I created a new blank Universal App solution and added the Windows 8.1 project files manually.  It works as expected now.

    I do still have the "broken" solution.  I will give your suggestion a try when I get some time.

    Thanks for your input

    • Marked as answer by johnGNJ Sunday, August 24, 2014 1:28 PM
    Thursday, May 22, 2014 5:59 PM