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
In a NAOT enabled project, the regular .NET compilation (not the AOT publish) fails inside Visual Studio (only) if a Memory<byte> argument is used in a JS exported method. Accordingly to this message, Memory<byte> can be used to project a UInt8Array parameter in JS, and this works perfectly with a compilation issued from the command line with dotnet build or dotnet publish . Instead, the regular .NET compilation inside Visual Studio fails with the following generator related error:
Error (active) NAPI1001 NotSupportedException : Unnamed types are not supported: void*
at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.AsType(ITypeSymbol typeSymbol, Type[] genericTypeParameters, Boolean buildType)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.BuildSymbolicConstructor(TypeBuilder typeBuilder, IMethodSymbol constructorSymbol, Type[] genericTypeParameters)
at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.BuildSymbolicTypeMembers(ITypeSymbol typeSymbol, TypeBuilder typeBuilder, Type[] genericTypeParameters)
at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.BuildSymbolicObjectType(INamedTypeSymbol typeSymbol, String typeFullName, Type[] genericTypeParameters, Boolean buildType) at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.AsType(ITypeSymbol typeSymbol, Type[] genericTypeParameters, Boolean buildType)
at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.BuildSymbolicMethod(TypeBuilder typeBuilder, IMethodSymbol methodSymbol, Type[] genericTypeParameters) at Microsoft.JavaScript.NodeApi.Generator.SymbolExtensions.BuildSymbolicTypeMembers(ITypeSymbol typeSymbol, TypeBuilder typeBuilder, Type[] genericTypeParameters) aot-npm-package E:\node-api-dotnet\examples\aot-npm-package\lib\CSC 1
Open lib/aot-npm-package.csproj with Visual Studio and replace Example.cs with the following content:
using System;
namespace Microsoft.JavaScript.NodeApi.Examples;
[JSExport]
public static class Example
{
public static void Foo(Memory<byte> bytes)
{
}
}
Build the solution (F6)
-> Error.
The text was updated successfully, but these errors were encountered:
In a NAOT enabled project, the regular .NET compilation (not the AOT publish) fails inside Visual Studio (only) if a
Memory<byte>
argument is used in a JS exported method. Accordingly to this message,Memory<byte>
can be used to project aUInt8Array
parameter in JS, and this works perfectly with a compilation issued from the command line withdotnet build
ordotnet publish
. Instead, the regular .NET compilation inside Visual Studio fails with the following generator related error:Steps to reproduce:
examples/aot-npm-package
dotnet pack ../..
lib/aot-npm-package.csproj
with Visual Studio and replaceExample.cs
with the following content:The text was updated successfully, but these errors were encountered: