How do I export a C# function with a `JSValue` argument?
@jasongin ci sta già lavorando.
Dal 10/1/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 783
- Fork
- 80
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/node-api-dotnet
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
microsoft/node-api-dotnet#484 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/node-api-dotnet#481 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoft/node-api-dotnet#486 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoft/node-api-dotnet#483 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/node-api-dotnet#479 ·
Tutte le issue di microsoft/node-api-dotnet
Issue simili
-
bug P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nightscout/nocturne#1908 ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation Needs: Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
WPF: each page's `Title` overwrites the window title, and returning to a page does not restore itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows area/Docs partner/agentic-workflows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jamesmontemagno/tiny-clips#378 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno