【问题标题】:XamlParseException: ''Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exceptionXamlParseException:''在'System.Windows.Markup.StaticResourceHolder'上提供值引发异常
【发布时间】:2019-01-26 17:33:08
【问题描述】:

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

我遇到了这个问题,因为我从 TFS 下载了新版本的解决方案

该解决方案可以正确编译,并且在使用该解决方案的其他开发人员的机器上运行良好,但我的除外。

异常跟踪:

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      

我认为问题不在于代码,而在于我的机器,因为现在即使是旧版本的解决方案(过去可以正常工作)也得到同样的异常并且无法编译。

谁能帮我找出问题所在!?

【问题讨论】:

  • 如果你从 TFS 下载旧版本一切正常?
  • @ShaykiAbramczyk TFS 的旧版本不适合我,但可以在其他机器上工作。
  • @mm8 ,这个解决方案里面有13个项目,我不能告诉你代码中是否抛出了NotImplementedException
  • 为什么不呢?您认为其他甚至无法访问您的代码的人将如何判断?只需在视觉工作室中搜索这个词。或者调试你的代码。
  • @mm8 我刚刚验证过,整个解决方案中没有抛出NotImplementedException

标签: .net wpf xaml exception


【解决方案1】:

终于解决了这个问题

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

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

【讨论】:

    猜你喜欢
    • 2012-04-17
    • 2016-05-24
    • 2011-04-23
    • 1970-01-01
    • 2012-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多