We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

When Referencing Assemblies: "The type initializer for 'Syncfusion.UI.Xaml.Controls.Notification.SfHubTile' threw an exception"

I'm trying to reduce my app deployment size by referencing the assemblies directly, rather than referencing the SDK. I've got it narrowed down to the assemblies I need, but even when referencing all of the assemblies, I'm getting an error:
{"The type initializer for 'Syncfusion.UI.Xaml.Controls.Notification.SfHubTile' threw an exception."}

To reproduce this, I've put together a sample, but here's all that I need to do to get the exception to occur:

SfHubTile sampleHub = new SfHubTile();


Again, I'm referencing the assemblies, not the SDK. If I use the SDK, everything works fine, but my app size is much larger than I'd like.

Here's the stack trace:
   at Syncfusion.UI.Xaml.Controls.Notification.SfHubTile..ctor()
   at SampleApp.MainPage..ctor()
   at SampleApp.SampleApp_WindowsPhone_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_MainPage()
   at SampleApp.SampleApp_WindowsPhone_XamlTypeInfo.XamlUserType.ActivateInstance()

Thanks!

Attachment: SampleApp_161f387c.zip

3 Replies

MS Matt Shanahan December 29, 2015 12:11 AM UTC

I think I figured it out.

Included in the SDK are several Themes that aren't embedded in the DLLs. In the Redist\CommonConfigurationeutral folder, I copied the Syncfusion.SfHubTile.Universal folder into the root of my Shared project, then changed the build action of every file to Content. After that, the sample app launches without error. I'm going to implement this into my actual app now but unless I write back, I think this matter is resolved.

Thanks!


MS Matt Shanahan December 29, 2015 02:31 AM UTC

Just one more thing to follow up with. When adding the files in the Redist\CommonConfigurationeutral folder, also add the .pri files at the bottom that correspond with the assemblies that have been referenced. Add those into the root of the Shared project and set the build action to Content, and it worked!


PB Priyanga Balasubramaniam Syncfusion Team December 29, 2015 05:28 AM UTC

Hi Matt Shanahan,

We are glad that your issue has been fixed. Please let us know if you need any other assistance

Regards,
Priyanga B

Loader.
Live Chat Icon For mobile
Up arrow icon