Ambiguous type reference. A type named `VisualState` occurs in at least two namespaces

后端 未结 1 388
有刺的猬
有刺的猬 2021-01-01 08:50

What is the following error?

Ambiguous type reference. A type named \'VisualState\' occurs in at least two namespaces, \'System.Windows\' and \'System

1条回答
  •  佛祖请我去吃肉
    2021-01-01 09:49

    This error(most of the time warning) will occur when using two or more references which contains same namespace and classes. in your case you are using VisualState which is part of PresentationFramework assembly and you might have added another assembly which contains same "VisualState" object with the same namespace "System.Windows" .

    you can resolve the error using following imports in your xaml

    xmlns:vsm ="clr-namespace:System.Windows;assembly=PresentationFramework"
    

    instead of using

    
                                            
    
                                            
                                        
    

    Use:

    
                                        
    
                                        
                                    
    

    0 讨论(0)
提交回复
热议问题