LightSwitch RIA Services: Get Error "Could Not Load Type" in Update Data Source Screen when Entity field's type is defined in a separate assembly

StackOverflow https://stackoverflow.com/questions/15146650

質問

I have a LightSwitch project in VS 2012 that has an RIA Data Source reference to the assembly Pbs.OpportunityTracker.Ria. One of the entities in that assembly's domain service has a property of an enum type, AppointmentStatus, that is defined in another assembly, named Pbs.Crm. Pbs.OpportunityTracker.Ria references that assembly and builds fine. However, when I go to the LightSwitch project to update the data source, the dialog presents an error: Could not load type 'Pbs.Crm.Repository.AppointmentStatus' from assembly 'Pbs.Crm, ...'.

It seems the LightSwitch designer is only able to deal with types defined directly in the RIA assembly. Moving the enum type is not an option, and defining a second enum type would require some rather tricky modifications to the custom QueryProvider, though it would be doable. Still, it's not ideal. Anyone know of the reason behind this limitation and if there's a way to work around it?

役に立ちましたか?

解決

This seems to be a bug in the LightSwitch designer. Since enumerations, along with other non-built-in types, are not supported, the creators of the LightSwitch designer did not account for the possibility that the entity's fields could be defined in another assembly. Still, this error message is confusing and misleading, obscuring the real error, which is that enumerated types are not supported.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top