How do I export a C# function with a `JSValue` argument?
@jasongin y travaille déjà.
Depuis le 10/1/2025.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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.
- Langage dominant
- C#
- Étoiles
- 783
- Forks
- 80
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/node-api-dotnet
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
microsoft/node-api-dotnet#484 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
microsoft/node-api-dotnet#481 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
microsoft/node-api-dotnet#486 · 1 commentaire ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
microsoft/node-api-dotnet#483 · 1 commentaire · 1 réaction ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
microsoft/node-api-dotnet#479 ·
Toutes les issues de microsoft/node-api-dotnet
Issues similaires
-
WPF: each page's `Title` overwrites the window title, and returning to a page does not restore itOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
agentic-workflows area/Docs partner/agentic-workflows
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
jamesmontemagno/tiny-clips#378 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
go 🏃 testing 🧪
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
valkey-io/valkey-glide#7239 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
SubtitleEdit/subtitleedit#15462 ·
Les mainteneurs répondent en général sous 1 jour