locked
Setting the Build Action for a folder in VS for a Win 8.1 app

    Question

  • In previous Windows 8 /8.1 projects, any images that I have added to a folder inside the Assets folder is automatically set to "Content" in the Build Action.

    Build action set to content.

    As a result, the images render when the project is built.

    But our latest project seems to default to BundleResource, and after wasting time trying to work out why the image isn't rendering, I remember that I have to manually change each image to Content.

    Does anyone know how to set the whole folder to Content so that newly added images will be Content by default? I don't know why this project is behaving differently to our previous ones. :-(

    Wednesday, July 23, 2014 1:52 PM

Answers

  • Hi,

    I don't think you can change the build action by selecting a folder, but you can select multiple files by holding the shift key and set the build action for all the selected files.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, July 24, 2014 8:30 AM

All replies

  • Hi,

    You can edit .csproj file in windows store app. select upload project:

    And then select edit .csproj file ,add the code in the file:

     <ItemGroup>
    	<Content Include="Assets\Logo.scale-100.png" />
    	<Content Include="Assets\SmallLogo.scale-100.png" />
    	<Content Include="Assets\SplashScreen.scale-100.png" />
    	<Content Include="Assets\StoreLogo.scale-100.png" />
      </ItemGroup>

    And I think you can post your thread to MsBuild Forum. You can get more professional help in there.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, July 24, 2014 2:01 AM
  • Hi Anne,

    Thanks for you answer. But I am looking to make the entire Assets folder Content, rather than adding individual images, as that is effectively what I have to do now.

    I will take your suggestion of posting on MsBuild forum and see if anyone there knows how to set folders to Content.

    Many thanks for you fast response.

    Thursday, July 24, 2014 8:26 AM
  • Hi,

    I don't think you can change the build action by selecting a folder, but you can select multiple files by holding the shift key and set the build action for all the selected files.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, July 24, 2014 8:30 AM