积极答复者
System.Windows.VisualState同时存在于2个文件中,急,编译不过!!

问题
-
错误 2 类型“System.Windows.VisualState”同时存在于“c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll”和“d:\fsti\SpossWpf\sposs5_cs\SPOSS2012\SPOSS2012\bin\Debug\WPFToolkit.dll”中 D:\fsti\SpossWpf\sposs5_cs\SPOSS2012\SPOSS2012\SpossUserControl\PhotoFrame.xaml
错误如上。System.Windows命名空间在2个DLL中均存在,在xaml中,定义了xmlns:vsm="clr-namespace:System.Windows;assembly=WPFToolkit"(也尝试了定义为:xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework")
引用VisualState的时候:<vsm:VisualState x:Name="ImageChanged2"/>
编译器还是会混淆,为何?求解答
答案
-
你好,
尝试清理一下你的application或者Solution(在solution Explorer窗口中单击application- 右键-clean或者单击solution-右键-clean solution ), 然后在你的xaml中声明如下:
xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
测试代码如下:
<vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup> <vsm:VisualState x:Name="ImageChanged2"/> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups>
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 Lisa ZhuModerator 2013年3月19日 1:34
全部回复
-
你好,
尝试清理一下你的application或者Solution(在solution Explorer窗口中单击application- 右键-clean或者单击solution-右键-clean solution ), 然后在你的xaml中声明如下:
xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
测试代码如下:
<vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup> <vsm:VisualState x:Name="ImageChanged2"/> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups>
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- 已标记为答案 Lisa ZhuModerator 2013年3月19日 1:34
-
你好,
我临时将我的回复标记为答案,如果该回复对你没有帮助的话请随时 回来取消标记答案。 感谢你的理解与支持。
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.