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 trying to load team tabs using PnPContext we get the following exception:
System.FormatException:Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
Steps to reproduce
This is the code we are executing (the exception happens on line 83)
Here is the Stacktrace:
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(Boolean overflow, String failureMessageID)
at System.Guid.TryParseExactN(ReadOnlySpan1 guidString, GuidResult& result) at System.Guid.TryParseGuid(ReadOnlySpan1 guidString, GuidResult& result)
at System.Guid.Parse(ReadOnlySpan1 input) at System.Guid.Parse(String input) at PnP.Core.Services.JsonMappingHelper.GetJsonFieldValue(IDataModelWithContext pnpObject, String fieldName, ApiResponse apiResponse, JsonElement jsonElement, Type propertyType, Boolean useCustomMapping, Func2 fromJsonCasting)
at PnP.Core.Services.JsonMappingHelper.FromJsonGraph(TransientObject pnpObject, EntityInfo entity, ApiResponse apiResponse, Func2 fromJsonCasting) at PnP.Core.Services.JsonMappingHelper.FromJson(TransientObject pnpObject, EntityInfo entity, ApiResponse apiResponse, Func2 fromJsonCasting)
at PnP.Core.Model.BaseDataModel1.ProcessResponseAsync(ApiResponse apiResponse, Expression1[] expressions)
at PnP.Core.Services.JsonMappingHelper.FromJsonGraph(TransientObject pnpObject, EntityInfo entity, ApiResponse apiResponse, Func2 fromJsonCasting) at PnP.Core.Services.JsonMappingHelper.FromJson(TransientObject pnpObject, EntityInfo entity, ApiResponse apiResponse, Func2 fromJsonCasting)
at PnP.Core.Services.JsonMappingHelper.MapJsonToModel(BatchRequest batchRequest)
at PnP.Core.Services.BatchClient.ProcessGraphRestBatchResponse(Batch batch, String batchResponse)
at PnP.Core.Services.BatchClient.ExecuteMicrosoftGraphBatchRequestAsync(Batch batch)
at PnP.Core.Services.BatchClient.ExecuteMicrosoftGraphBatchAsync(Batch batch)
at PnP.Core.Services.BatchClient.ExecuteBatch(Batch batch)
at PnP.Core.Model.BaseDataModel1.BaseRetrieveAsync(ApiCall apiOverride, Func2 fromJsonCasting, Action1 postMappingJson, Expression1[] expressions)
at CN365Common.Validation.Validators.CN365Template.ChannelTabs.Validate(PnPContext pnpContext, String channelId) in /home/vsts/work/1/s/CN365Common/Validation/Validators/CN365Template/ChannelTabs.cs:line 83
Based on the PnP model of TeamChannelTab, the Id is expected to be a Guid, but in our case we have multiple Channels where the Tab-Id seems to be an Integer.
Here the results from the Graph Request
Definition in PnP Model
Expected behavior
Teams Tabs can be loaded into PnP model even if the Tab-Id is not a Guid
Thanks for using PnP Core SDK @nicolaor and reporting this issue. The underlying used graph API indeed returns a string as id, I'll update this in the SDK (will be a small breaking change for folks using this, but will mention this in the release notes).
Category
Describe the bug
When trying to load team tabs using PnPContext we get the following exception:
Steps to reproduce
This is the code we are executing (the exception happens on line 83)
Here is the Stacktrace:
Based on the PnP model of TeamChannelTab, the Id is expected to be a Guid, but in our case we have multiple Channels where the Tab-Id seems to be an Integer.
Here the results from the Graph Request
Definition in PnP Model
Expected behavior
Teams Tabs can be loaded into PnP model even if the Tab-Id is not a Guid
Environment details (development & target environment)
Additional context
This behavior seems to affect only older teams, newly created Teams always have use Guids for the Tab Ids
The above Team was created in April 2020.
The text was updated successfully, but these errors were encountered: