-
Notifications
You must be signed in to change notification settings - Fork 77
Cannot set extension (extended) property #28
Comments
I am also having this issue - has there been an Active Directory update? |
@ronanscally hey, i still wasn't able to solve this. I think there was an update, I also tried to keep downgrading Client Library version by version and can reproduce the issue straight away, therefore not a Client Library issue. |
Does anyone have any update on this? |
no, unfortunately still having the same issues.... :( |
Thanks. Please keep us posted, this bug is eating me alive. |
This bug seems to have been introduced between Graph API library that depends on Microsoft.Data.Services.Client v5.7, compared to v5.6.4. I was able to workaround the problem either use assembly redirects in my App.config, or reverting back to the v5.6.4 package. |
I'm still struggling. I have this method that should create an extended property, but when it hits the await application.UpdateAsync() line, my simple console project exits. Any ideas?
} This is my packages.config |
This is affecting me as well. Oddly enough, I can test my exact same code out in LinqPAD and it works just fine. When I run it in my actual app is when it starts failing on me. Folks over here on SO are wondering similar things. Looks like this issue might be the one that resolves it. Alas, I ended up actually just reverting to 5.6.4.0 like everyone else. |
Alternative Workaround (v5.7 compatible)I've got an alternative workaround for this bug, for those that want to use the version 5.7 OData libraries rather than redirecting to the v5.6.4 versions. Add a request pipeline configuration handler.
In the handler, change the ODataUndeclaredPropertyBehaviorKinds value on the writer settings to SupportUndeclaredValueProperty.
Some background for those that care.Looking at the stack trace produced from the error: "The property 'extension_....' does not exist on type 'Microsoft.Azure.ActiveDirectory.GraphClient.Internal.User'. Make sure to only use property names that are defined by the type."
The ValidatePropertyDefined() is passed a ODataUndeclaredPropertyBehaviorKinds value that is None by default, by changing that value to SupportUndeclaredValueProperty we can avoid the exception. So look at the WriteEntry() method further up the stack, it creates a new ODataMessageWriter with ODataMessageWriterSettings. There is no way to customize these settings that I could find, they are created as a local instance and never exposed outside of WriteEntry(). However, we can plug into the writer pipeline through the Context.Configurations object. The handler passed to OnMessageWriterSettingsCreated is passed a MessageWriterSettingsArgs with that ODataMessageWriterSettings instance. The MessageWriterSettingsArgs object contains a shim (of type DataServiceClientMessageWriterSettingsShim) for the settings but we need A more intelligent handler would only switch the value for the specific methods you need. No guarantees of what side-effects might be, but in my testing it works fine. Tested and working with the latest packages (at time of writing):
Enjoy! |
@ecosgrave your solution worked for me with the following versions.
|
Sure would be nice to see this fixed - ended up having to use the workaround in version 5.8.4. |
I have no success in setting extended property whatever I do. I have isolated the reproducible piece of code:
user.UpdateAsync() according to Fiddler doesn't even go out and application fails with an exception:
"The property 'extension_e206e28ff36244b19bc56c01160b9cf0_UserEEEqdbtgd3ixx2' does not exist on type 'Microsoft.Azure.ActiveDirectory.GraphClient.Internal.User'. Make sure to only use property names that are defined by the type."
The text was updated successfully, but these errors were encountered: