XamlParseException:”在'System.Windows.Markup.StaticResourceHolder'上提供值引发了异常

时间:2018-08-20 14:44:35

标签: .net wpf xaml exception

使用VS-2017并开发与其他开发人员在TFS中共享的WPF(MVVM模式)解决方案

自从TFS下载该解决方案的新版本以来,我就遇到了这个问题

该解决方案可以正确编译,并且可以在除我之外的其他使用该解决方案的开发人员的机器上正常工作。

ExceptionTrace:

System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='Provide value on 'System.Windows.Markup.StaticResourceHolder' 
threw an exception.' Line number '33' and line position '10'.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, 
IXamlLineInfo lineInfo, Uri baseUri)

Inner Exception 1:
NotImplementedException: The method or operation is not implemented.

详细信息:

-       $exception  {"'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Line number '33' and line position '10'."}    System.Windows.Markup.XamlParseException
+       BaseUri null    System.Uri
+       Data    {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
        HResult -2146233087 int
        HelpLink    null    string
+       IPForWatsonBuckets  0x000007fee1c3a3c4  System.UIntPtr
+       InnerException  {"The method or operation is not implemented."}  
System.Exception {System.NotImplementedException}
    IsTransient false   bool
    KeyContext  null    object
    LineNumber  33  int
    LinePosition    10  int
    Message "'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Line number '33' and line position '10'."  string
    NameContext null    string
    RemoteStackTrace    null    string
    Source  "PresentationFramework" string
    StackTrace  "   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)"  string
+       TargetSite  {Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
    UidContext  null    string
    WatsonBuckets   null    object
    _HResult    -2146233087 int
+       _baseUri    null    System.Uri
    _className  null    string
+       _data   {System.Collections.ListDictionaryInternal} System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
    _dynamicMethods null    object
+       _exceptionMethod    {Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
    _exceptionMethodString  null    string
    _helpURL    null    string
+       _innerException {"The method or operation is not implemented."} System.Exception {System.NotImplementedException}
+       _ipForWatsonBuckets 0x000007fee1c3a3c4  System.UIntPtr
    _keyContext null    object
    _lineNumber 33  int
    _linePosition   10  int
    _message    "'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Line number '33' and line position '10'."  string
    _nameContext    null    string
    _remoteStackIndex   0   int
    _remoteStackTraceString null    string
+       _safeSerializationManager   {System.Runtime.Serialization.SafeSerializationManager} System.Runtime.Serialization.SafeSerializationManager
    _source "PresentationFramework" string
+       _stackTrace {sbyte[48]} object {sbyte[]}
    _stackTraceString   null    string
    _uidContext null    string
    _watsonBuckets  null    object
    _xcode  -532462766  int
+       _xptrs  0x0000000000000000  System.IntPtr
+       Static members      

我认为问题不在代码中,而在我的机器中,因为现在即使解决方案的旧版本(过去运行正常)也遇到了相同的Exception,并且无法编译。

有人可以帮助我发现问题所在吗??

1 个答案:

答案 0 :(得分:0)

最后我解决了这个问题

我将解决方案移到了新目录,但我不知道“ Carmenta”文件夹已添加到项目目录。

所以我刚刚编辑了环境变量,它工作正常