You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call the function AddAvailableContentTypeFromHubAsync on a list or site, a MicrosoftGraphServiceException is thrown.
For example the following lines throw this exception:
var contentType = _pnpContext.ContentTypeHub.ContentTypes.AsRequested().FirstOrDefault(ct => ct.StringId == contentTypeId);
await _pnpContext.Web.ContentTypes.AddAvailableContentTypeFromHubAsync(contentType.StringId, new AddContentTypeFromHubOptions { WaitForCompletion = true });
await list.ContentTypes.LoadAsync();
await list.ContentTypes.AddAvailableContentTypeFromHubAsync(contentType.StringId, new AddContentTypeFromHubOptions { WaitForCompletion = true });
The Exception itself does not contain any data - also no error message. Just a status code of 202 is shown.
When I inspect the traffic with fiddler, I can see multiple graph calls that are checking if the job has finished. Those calls are (like expected) continued until the graph returns a success.
Then the above exception is thrown.
Expected behavior
No Exception anymore if AddAvailableContentTypeFromHubAsync is called successfully.
@web265p3 : I've reproduced this issue and fixed it. The fix will be part of the next nightly build (version 1.9.43 or higher). Closing this issue now, if you still have this problem when using the next nightly then please re-open or create a new issue with additional details.
Category
Describe the bug
When I call the function AddAvailableContentTypeFromHubAsync on a list or site, a MicrosoftGraphServiceException is thrown.
For example the following lines throw this exception:
The Exception itself does not contain any data - also no error message. Just a status code of 202 is shown.
When I inspect the traffic with fiddler, I can see multiple graph calls that are checking if the job has finished. Those calls are (like expected) continued until the graph returns a success.
Then the above exception is thrown.
Expected behavior
No Exception anymore if AddAvailableContentTypeFromHubAsync is called successfully.
Environment details (development & target environment)
.Net 6, Visual Studio 2022
The text was updated successfully, but these errors were encountered: