How do I export a C# function with a `JSValue` argument?
@jasongin arbeitet bereits daran.
Seit 10.1.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
As per issue title, I'm trying to export a C# class method using TypeExporter.ExportType, but the method is not exported due to the following check, which explicitly disallows JSValue argument types and causes the method to be skipped:
The method has the following signature:
public async Task<JSValue> sendMessage(JSValue parameters)
The purpose of the C# function is:
- to call
JSON.stringify - parse the result with
System.Text.Json - execute some C# code,
- serialize the result with
System.Text.Json - call
JSON.parseagain to return the result to nodeJS.
(I know, the JSON round-trip could be removed in the future by creating a DTO type, but the JSON data currently has a dynamic structure and needs some work)
Changing the signature to a string and using JSON.stringify in NodeJs is a workaround to make the method appear, but I'd like to pass a JSON object directly.
- Vorherrschende Sprache
- C#
- Sterne
- 785
- Forks
- 80
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/node-api-dotnet
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
microsoft/node-api-dotnet#484 ·
-
Embedding args occasionally get trailing garbage on .NET (missing null terminator on a pooled buffer)Evtl. vergeben @tolmachev-pravo hat das vor 87 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
microsoft/node-api-dotnet#481 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 82/100
microsoft/node-api-dotnet#502 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
microsoft/node-api-dotnet#486 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
microsoft/node-api-dotnet#483 · 1 Kommentar · 1 Reaktion ·
Alle Issues in microsoft/node-api-dotnet
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
AvaloniaUI/Avalonia#22420 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
dotnet/SqlClient#4823 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
type/automation type/tech-debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
area-testing p1-recommended
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
StackExchange/StackExchange.Redis#3269 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag