The closed component does not have the corresponding IsMultimedia property.

I created a service link in Visual Studio on the OData webservice CD on SDL Tridion 2011 SP1, and everything works fine, but when I request a specific component with code like this:

ContentDeliveryService cdService1 = new ContentDeliveryService(new Uri("http://xxx:81/odata.svc")); var item = cdService1.Components.Where(p => p.ItemId == 29 && p.PublicationId == 1).First(); Console.WriteLine(item.ItemId); 

This is an exception to the exception:

  The closed type ConsoleApplication1.CdService.Component does not have a corresponding IsMultimedia settable property. 

Does anyone know what to fix?

+6
source share
2 answers

I assume that the problem is that the server is sending you a property that the client does not know about (the IsMultimedia property). You can confirm this using, for example, Fiddler to see the response from the server. This can happen if the type of the component on the server is marked as open (may have more properties than declared). The client library today does not support open types.

If you do not need the IsMultimedia property on the client, you can suppress this error by setting cdService1.IgnoreMissingProperties = true.

If you need the IsMultimedia property on the client, the Component class generated for you must be a partial class, so you can add its IsMultimedia property manually. Then it should also work.

+7
source

This is apparently a defect that will be fixed in the next version. Installing IgnoreMissingProperties works, another solution is to open the Reference.cs file of this link and change the public global::System.Nullable<bool> Multimedia IsMultimedia to IsMultimedia

+3
source

Source: https://habr.com/ru/post/915170/


All Articles