Wednesday, November 17, 2010 4:07 PM
I'm working on a project where I have to use an Accordion-control. I found that control in the WPFToolkit (February 2010 release) and I installed the package (.msi file) and included the references to wpftoolkit.dll, System.Windows.Controls.Layout.Toolkit & System.Windows.Controls.Layout.Toolkit.Design in my SketchFlow project, so far so good.
However, when I try to compile my project I get several errors saying that:
Error 2 The type 'System.Windows.VisualStateGroup' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\PresentationFramework.dll' and 'c:\Program Files\WPF Toolkit\v3.5.50211.1\WPFToolkit.dll' ...
I tried to specify a namespace for the .NET4.0 VisualStateManager by using the following line:
and in the code refence the VisualStateManager by using the following code:
Does anyone know how I can resolve this conflict?
Thanks in advance!
Wednesday, November 17, 2010 5:08 PMModeratorI believe that in .Net 4 you don't need a reference to the WPFToolkit.dll, I think everything in it is already included in .Net 4, try removing it from your project references.
Thursday, November 18, 2010 12:59 PM
Thanks for your reply. I've been working a couple of weeks without the Wpftookit until I got the need for the Accordion-control. This control seems to be excluded from .NET FW4.0 and is not included in the Extended Wpftoolkit, the only place I've found the Accordion-control is in the ordinary Wpftoolkit (February release), and this toolkit seems to be created for .NET FW 3.5 SP1.
However, to reply on your post. I have tried running the project without referencing Wpftoolkit.dll (I still reference System.Windows.Controls.Layout.Toolkit & System.Windows.Controls.Layout.Toolkit.Design though). When I try to compile this I get the following error message:
Error 1 Unknown build error, 'Cannot resolve dependency to assembly 'WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 348 Position 112.'
From what I found out on different blog-posts it seems like I have to reference Wpftoolkit.dll to get this to work, so I think I'm back on square one again.
Do you have any suggestion regarding how I can use the Accordion in my SketchFlow-project (and later a Wpf4.0 project)?
Thursday, November 18, 2010 2:38 PMModerator
The following steps work for me:
1. Open Blend
2. Create new WPF project, .Net 4
3. Add a reference to System.Windows.Controls.Layout.Toolkit.dll from wpftoolkit (the feb2010 release)
4. Add an accordion control
You mentioned a reference to a .design assembly, you might want to try removing that.
My references look like this:
All but the S.W.Controls.Layout.Toolkit.dll were there when I created the project.
If that doesn't work, feel free to zip up your project and email it to me at firstname.lastname@example.org using my name, and I'll see if I can figure out the problem.
Friday, November 19, 2010 3:51 PMModerator
For anyone else who comes across this question, this is how you can update the wpftoolkit projects to work for .Net 4/WPF 4 (taken from an email conversation):
OK, to start with, a disclaimer: this is in no way supported, official, or anything of that nature, it can and probably will change without any notice.
1. Opened up the wpftoolkit sln
2. Removed all the unrelated projects
3. Deleted their source from the folder
4. Right clicked each project, clicked properties, changed the target framework to 4.0 client profile
5. Find replace “vsm:” with “” (empty string, to remove the vsm: prefix)
6. Removed the xmlns declarations that declared vsm:
7. Removed any references to wpftoolkit
Hope this will work for you, you can either build the assemblies and reference the dlls, or add these projects to your sln and reference them that way.
- Marked As Answer by zalle Friday, November 19, 2010 3:53 PM
Tuesday, August 02, 2011 7:03 PMSo you say the only solution to this problem is: open source code of the toolkit. Remove vsm stuff. Rebuild. Reference.. It looks like the only option but it's still not a great option..