在显示中文的时候出错,我用的是Silverlight 2,VS2008 SP1 (日文韩文等都会出这个错)

songjinxi123 2009-07-17 05:34:47
错误 1 “ValidateXaml”任务意外失败。
System.Xml.XmlException: 给定编码中的字符无效。 行 22,位置 40。
在 System.Xml.XmlTextReaderImpl.Throw(Exception e)
在 System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
在 System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res)
在 System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
在 System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
在 System.Xml.XmlTextReaderImpl.ReadData()
在 System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
在 System.Xml.XmlTextReaderImpl.ParseAttributes()
在 System.Xml.XmlTextReaderImpl.ParseElement()
在 System.Xml.XmlTextReaderImpl.ParseElementContent()
在 System.Xml.XmlTextReaderImpl.Read()
在 MS.Internal.Xaml.XmlCompatibilityReader.Read()
在 MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
在 MS.Internal.Xaml.Parser.XamlScanner.Read()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__23.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementContent>d__39.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__23.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementContent>d__39.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__23.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
在 MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__0.MoveNext()
在 MS.Internal.Xaml.TextReaderEnumerator.MoveNext()
在 MS.Internal.Xaml.XamlTextReader.Read()
在 MS.MarkupCompiler.ValidationPass.ValidateXaml(String fileName, Assembly[] assemblies, Assembly callingAssembly, TaskLoggingHelper log, Boolean shouldThrow)
在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute()
在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute()
在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
在 Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult) SimpleSamplesSilverlight
...全文
178 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuyiping122 2011-11-09
  • 打赏
  • 举报
回复
我也碰到了。。、
WonSunBeen 2010-09-15
  • 打赏
  • 举报
回复
我也遇到过这问题,我当时是用silverlight3做自定义控件,做好运行时出题,出错代码跟楼主贴出的几乎是一样的。
通过查找,发现在generic.xaml文件中,我在一个控件定义时把其属性值用中文写的,改成英文,问题就得到解决了。
louhuan123 2010-07-26
  • 打赏
  • 举报
回复
我也碰到了
lmg1988 2009-12-16
  • 打赏
  • 举报
回复
我也遇到同样的问题,应该怎么弄啊
jv9 2009-07-17
  • 打赏
  • 举报
回复
Silverlight支持中文编码。 是不是你的代码进行类型转换验证出错?

8,734

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧