Asked by:
[UWP] Design-time metadata assemblies

Question
-
I have successfully created metadata assemblies for custom control libraries for both WPF and Windows 8.1 apps by implementing IProvideAttributeTable in a separate Design assembly. Both work in VS/Blend 2015.
UWP apps seems to behave differently in design-time and I cannot get my metadata assembly to load without error. It gets copied to the ShadowCache folder but it fails to load and shows this error message:
There was an exception when loading the design time assembly 'C:\Users\<user>\AppData\Local\Microsoft\Blend\14.0\Designer\ShadowCache\jqqeotae.cel\lsr5bcbv.fti\bin_6\<mycontrols>.Design.dll':
Value cannot be null.
Parameter name: assemblyHas anyone created a working metadata assembly for a UWP control library? Do you know of any open source UWP project where design-time metadata assemblies are created?
Monday, October 26, 2015 1:48 PM
All replies
-
Have you followed the steps in this article: http://blog.sailmadeline.com/2013/07/15/creating-a-design-time-adorner-layer-in-windows-rt/
The import thing is to create an alias to the namespace of this library so that we can reference it from our .Net compiled design dll without a collision later
Best Regards,
Please remember to mark the replies as answers if they help- Edited by IssueKiller Tuesday, October 27, 2015 6:25 AM
Tuesday, October 27, 2015 6:25 AM -
Thanks! That was a much cleaner way to do it than my previous solution. I had to change one reference tag a bit for UWP:
<Reference Include="Windows Universal Runtime"> <HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd</HintPath> <Private>False</Private> <Aliases>WindowsUIXamlRuntime</Aliases> </Reference>
Unfortunately, it did not completely solve my problem but I finally realized that the error was isolated to x64. I have not tested all combinations, but running Blend 2015 with x64 as selected platform gives problems with design assemblies during design-time. The problem goes away if I change to x86 and rebuild.
If anyone has a solution for x64 design-time assemblies, please let me know.
Thursday, October 29, 2015 10:24 AM -
Unfortunately, it did not completely solve my problem but I finally realized that the error was isolated to x64. I have not tested all combinations, but running Blend 2015 with x64 as selected platform gives problems with design assemblies during design-time. The problem goes away if I change to x86 and rebuild.
If anyone has a solution for x64 design-time assemblies, please let me know.
Even though I was not dealing with metadata but just design-time data, your comment led me to find out that the x64 designer also has issues with the design data as well.
Almost a week after debugging in every imaginable way in order to be able to see my design time data (the designer was just showing the field/property names not the values), thanks to your comment, I found that if I switch the target to x86 the design time data will show.
[My design time data is actual instances of a class, not XML]
Before setting it to x64 I had "all platforms" set and it was failing as well, I suppose because the designer defaults to x64 or something like that I guess.
Design time data issues --> target x86.
Saturday, March 19, 2016 6:25 PM