Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7674525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:45:25+00:00 2026-05-31T16:45:25+00:00

So… is strange, I have the follow code in my Window control for setting

  • 0

So… is strange, I have the follow code in my Window control for setting the window icon, which works prefectly on Win7 machine:

  Icon="./Resources/MyWPF.ico"

in

<Window x:Class="MyWPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
    xmlns:misc="clr-namespace:MyWPF.Tools.Misc"
    xmlns:View="clr-namespace:MyWPF.View"
    xmlns:ScriptListView="clr-namespace:MyWPF.Tools.ScriptViewer.View"
    Title="Voysus System" WindowStartupLocation="CenterScreen" MinWidth="800"     MinHeight="600"            
    Icon="./Resources/MyWPF.ico"
    x:Name="_Root" Closing="_Root_Closing"> 

But then when it run on Server 2003 Standard x64/ WinXP Pro, both gives me error:

System.Windows.Markup.XamlParseException
Source: PresentationFramework
Message: Cannot convert string './Resources/MyWPF.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. The image decoder cannot decode the image. The image might be corrupted.  Error at object '_Root' in markup file 'VoysusSystem;component/mainwindow.xaml' Line 8 Position 95.
StackTrace:    at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
   at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
   at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
   at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
   at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
   at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
   at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
   at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
   at System.Windows.Markup.TreeBuilder.Parse()
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at VoysusSystem.MainWindow.InitializeComponent() in c:\SandBox\MyWPF\MyWPF\MainWindow.xaml:line 1
   at VoysusSystem.MainWindow..ctor() in C:\SandBox\MyWPF\MyWPF\MainWindow.xaml.cs:line 93
   at VoysusSystem.ViewModel.LoginViewModel.Login(String strPassword) in C:\SandBox\MyWPF\MyWPF\Main\ViewModel\LoginViewModel.cs:line 147
   at VoysusSystem.ViewModel.LoginViewModel.<.ctor>b__2(String str) in C:\SandBox\MyWPF\MyWPF\Main\ViewModel\LoginViewModel.cs:line 97

I also tried to use Icon="/MyWPF;component/Resources/MyWPF.ico"

But it also gaves me same error.

After I remove the line, the code stop throwing exception on both WinXP and WinServer2003.

And again, these code is runs fine in Win7 and displayed the icon on the Window properly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:45:27+00:00Added an answer on May 31, 2026 at 4:45 pm

    It happened to me once because used a high def full of color icon, which doesn’t seem to be correctly handled by the XP clients. Reduced the number of colors for the icon and it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an element like this: <span class=tool_tip title=The full title>The ful&#8230;</span> This seems
I have this xml <entry id=1008 section=articles> <excerpt><p>&#8230; in Richtung „Aus für Tierversuche. Kosmetik-Fertigprodukte
I see that some rss on xml have strange strings. For example, ... is
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
CGI.escapeHTML is pretty bad, but CGI.unescapeHTML is completely borked. For example: require 'cgi' CGI.unescapeHTML('&#8230;')
I have been making a wordpress template. i got stuck at some place... the
I have a form, one of the fields is a select field, with 5
I would like to run a str_replace or preg_replace which looks for certain words
I want to open a popup window of an Image on More Info link
I have a PDB file. Now it has two parts separated by TER. Before

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.