Reproduction:
- Create a Silverlight project
- Turn it to version 5
- Add references to the Silverlight Toolkit (using NuGet or direct)
- Add a DataForm to your page
- This is the exception the DataForm constructor throws:
{System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls.Data.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToke开发者_运维技巧n=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. [IO.FileName_Name] Arguments: System.Windows.Controls.Data.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.60401.00&File=mscorlib.dll&Key=IO.FileName_Name at System.Windows.Controls.DataForm..ctor()}
- Turn back to Silverlight 4
- Now everything is cool again
Weird note: it does work in the VS/Exp. Blend 5 designers
Any ideas?? Workaround???
Found a very strange workaround: After I returned the SL version to 4, and re-returned it to 5, everything works! (?!?)
Anyway I'm sure recompiling the source-code of the SL TK targeting SL5 will help anyway.
I could not resolve this problem, also taking a project that was SL version 4 then migrating to SL version 5 and trying to add a DataForm. Even though I referenced the December 2011 Silverlight 5 Toolkit, and I added a proper reference to the SL5 DataForm, because of the presence of SL version 4 assemblies I get an error.
Not sure how you can 're-return' and 'return' as suggested in the workaround but for now I think anybody migrating from SL 4 to SL5 and trying to add a dataform will experience this problem. Best to either start from a completely new SL5 project, or, forget about using dataform with a SL4 solution migrated to SL5?
精彩评论