0

I did the following:

I went to Properties -> Resources and added an existing file (iconSmall.ico). As a result, the file gets placed in the "Resources" folder of the solution. Now I want to use the Icon in my MainWindow, so I typed: Icon="" in the Window XAML-declaration and I immediately got the suggestion to use my .ico from my Resources. I tab-complete and get this:

Icon="pack://siteoforigin:,,,/Resources/iconSmall.ico"

Now, when I start the application, it says, that the directory can not be found, although the file is present in the exact location in the file system/the solution explorer and Visual Studio even suggested me the icon.

How is this possible?

Regards

  • Try to use "pack://application:,,,/NameOfDllWhereYourResourcesReside;component/FolderPath/iconSmall.ico" – EngineerSpock Mar 06 '15 at 08:32
  • I forgot to set "Build Action" to "Resource" and "Copy to Output Directory" to "Copy if newer". A classic example of a mental block. Thanks, @Engineer Spock –  Mar 06 '15 at 10:05

0 Answers0