Image shows up in Visual Studio designer but not during run-time

后端 未结 19 2043
独厮守ぢ
独厮守ぢ 2020-12-17 08:09

I\'m currently working w/ VS studio 2010, .NET 4.0. Here is my scenario:

I currently have a class library project called \"Images\" that contains a sub folder calle

19条回答
  •  情深已故
    2020-12-17 08:24

    This was driving me crazy. I tried lots of different things based on various articles but nothing worked. My xaml window and image are in a separate DLL from the executable assembly. Not sure if that was part of my problem.

    In the end I had success with:

    1. Make sure the image properties in the project has "Build Action" = "Resource", NOT "Embedded Resource"
    2. In the xaml, with the image tag selected, use the properties windows to select the Source dropdown since NOW the image appears in the dropdown list! This let visual studio format the string for me.

    The string visual studio formatted for my image was:

    
    

    where "Paperless.Common" was the name of my assembly, and "Checkbook.png" was my image that resided in a "Resources" folder.

提交回复
热议问题