microsoftgraph / msgraph-sdk-dotnet

Microsoft Graph Client Library for .NET!
https://graph.microsoft.com
Other
699 stars 247 forks source link

ExternalItemRequestBuilder.PutAsync throws an unhandled 'Parameter count mismatch' exception in System.Private.Corelib #2729

Open AlanPBourke opened 1 day ago

AlanPBourke commented 1 day ago

Describe the bug

Using standard C# code from customer Graph connector samples to upload external items to an existing connection. An unhandled, untrappable exception is thrown by the code below.

await graphClient.External
    .Connections[connectionId]
    .Items[item.Id]
    .PutAsync(item);

Expected behavior

The external item should be posted, or any exception handled.

How to reproduce

This is occurring in a project based on the standard Microsoft sample: https://devblogs.microsoft.com/microsoft365dev/lets-build-a-custom-microsoft-graph-connector/

Test project is available here: https://github.com/AlanPBourke/DataConnectorCopilot/tree/main

Steps:

  1. As per the Microsoft sample walkthrough, have a Tenant ID, Client ID, app registration and app client secret ready,
  2. In the project linked above, edit DataConnectorCopilot.cs and note at the top of Main() that it takes Tenant, Client and Client secret values from system environment variables, so create and populate those.
  3. Run the project. Select option 1 to create a connection and follow that through.
  4. Select option 4 to register the schema and wait for completion.
  5. Select option 6 to push data to the current connection, at which point it should fail.

To retry:

  1. Select option 2 to select an existing connection and pick the relevant one created above..
  2. Select option 6 to push data.

SDK Version

5.61.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ``` 'DataConnectorCopilot.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\DataConnectorCopilot.dll'. Symbols loaded. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'c:\program files\microsoft visual studio\2022\professional\common7\ide\commonextensions\microsoft\hotreload\Microsoft.Extensions.DotNetDeltaApplier.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.IO.Pipes.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.Overlapped.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Security.AccessControl.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Security.Principal.Windows.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Security.Claims.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.Loader.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Graph.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Step into: Stepping over non-user code 'DataConnectorCopilot.DataConnectorCopilot.Main' Step into: Stepping over non-user code 'DataConnectorCopilot.DataConnectorCopilot.
d__0..ctor' 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Azure.Identity.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Azure.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.Tasks.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\netstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Authentication.Azure.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Graph.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Net.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Identity.Client.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Diagnostics.DiagnosticSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Diagnostics.Tracing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Security.Cryptography.X509Certificates.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Security.Cryptography.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Net.Security.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Private.Uri.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Http.HttpClientLibrary.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Text.RegularExpressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Reflection.Emit.Lightweight.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Reflection.Emit.ILGeneration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Reflection.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Serialization.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Serialization.Text.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Serialization.Form.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.Kiota.Serialization.Multipart.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Text.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Text.Encodings.Web.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.Intrinsics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Numerics.Vectors.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Std.UriTemplate.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Microsoft.IdentityModel.Abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Net.Sockets.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\Microsoft.Win32.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Net.NameResolution.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.ThreadPool.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.ObjectModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.Channels.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.IO.Compression.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.Serialization.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\Newtonsoft.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Users\abourke\source\Workspaces\Workspace2023\R_and_D\DataConnectorCopilot\DataConnectorCopilot\bin\Debug\net8.0\TextCopy.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. SalesAccounts?Select=Name,SalesAccountCode,Memo,AddressLine1,AddressLine2,AddressLine3,AddressLine4,PostCode,SalesOrderEmail,TelephoneNumber,OrdrContact,OrderBalance&$Expand=SOPHeaders($select=DocumentNumber,SalesOrder,OrderDate,CustomerReference,NarrativeLine1,NarrativeLine2,ExcludingVat,Vat,Memo,DueDate,RaisedBy;$filter=Status eq 'O' and RecordStatus eq 1;$Expand=SOPTransactions($select=DocumentNumber,StockReference,ItemPrice,Memo,LineQuantity,GoodsValue,CostPrice,VatAmount,Description,;$filter=RecordStatus eq 1 and Status eq 'A');$orderby=OrderDate desc)&$Filter=RecordStatus eq 1 and dormant eq false and stop eq false 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Threading.Thread.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. StockItems?select=StockReference,Description,SearchReference1,SearchReference2,SellingPrice,CostPrice,Memo&$Expand=StockProfile($select=StockProfileCode,Description,QDecimalPlaces,PDecimalPlaces;$filter=RecordStatus eq 1)&$filter=RecordStatus eq 1 and dormant eq false 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.Serialization.Formatters.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Diagnostics.TraceSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Linq.Expressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Runtime.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.ComponentModel.TypeConverter.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Data.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Xml.ReaderWriter.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.Private.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.10\System.ComponentModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'DataConnectorCopilot.exe' (CoreCLR: clrhost): Loaded 'Anonymously Hosted DynamicMethods Assembly'. Exception thrown: 'System.Reflection.TargetParameterCountException' in System.Private.CoreLib.dll Exception thrown: 'System.Reflection.TargetParameterCountException' in System.Private.CoreLib.dll Exception thrown: 'System.Reflection.TargetParameterCountException' in System.Private.CoreLib.dll An exception of type 'System.Reflection.TargetParameterCountException' occurred in System.Private.CoreLib.dll but was not handled in user code Parameter count mismatch. The program '[10340] DataConnectorCopilot.exe' has exited with code 4294967295 (0xffffffff). ```

Configuration

Windows 11 23H2 Intel x64 NET SDK 8.0.403

Other information

No response

AlanPBourke commented 1 day ago

FWIW, doesn't work with the current NET 9 preview either.

AlanPBourke commented 1 day ago

On further investigation it is failing in the Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteAdditionalData() method when it gets to processing the Collection(DateTimeOffset) items in the AdditionalData properties.

I've tried passing it orderDates both as a List<DateTime> and a List<DateTimeOffset> but neither seem to work ...

So my AdditionalData has:

{ "OrderDates@odata.type", "Collection(DateTimeOffset)" },
{ "OrderDates", orderDates },