none
How can I add an Icon to a WPF application?

    Question

  • I tried to add an Icon to my WPF project by edition the Application Properties page but since I added the Icon I only get this error while compiling:

    CVTRES : fatal error CVT1103: cannot read file

    vbc : error BC31019: Unable to write to output file 'D:\Development\Visual Studio 2005\JCsTools.VocabularyTrainer\JCsTools.VocabularyTrainer.UX\obj\Debug\JCsTools.VocabularyTrainer.UX.exe': System Error &H80070714&

    Saturday, January 14, 2006 9:54 PM

Answers

  • I created the Icon with Axilias Icon Workshop and defined a lot of Icon formats (including new Vista PNG Icon formats).´

    I removed all those formats and created a new icon with 48,32,24 and 16 32 Bit Alpha XP formats. This worked for me.

    Monday, January 16, 2006 7:42 PM

All replies

  • make sure that path is correct, to make sure copy the entinre string, and post it into the "Run" command window and see if it'll hit
    Sunday, January 15, 2006 5:48 AM
  • The Filename matches exactly and Project Page displays the icon but I get the error when compiling.

    Adding this Icon to a WinForms Application/Console Application works fine!

    Sunday, January 15, 2006 3:50 PM
  • You need to declare the icon file as an application Resource or loose Content. Can you verify that you have an entry like this in your project file (the .csproj or .vbproj):

    <PropertyGroup>
     
    <ApplicationIcon>Resources\MyAppIcon.ico</ApplicationIcon>
    ...
    </PropertyGroup>
    ...
    <ItemGroup>
      <Resource Include="Resources\MyAppIcon.ico" />
    ...
    </ItemGroup>

    This approach works for me.

    Monday, January 16, 2006 6:49 PM
    Moderator
  • I created the Icon with Axilias Icon Workshop and defined a lot of Icon formats (including new Vista PNG Icon formats).´

    I removed all those formats and created a new icon with 48,32,24 and 16 32 Bit Alpha XP formats. This worked for me.

    Monday, January 16, 2006 7:42 PM