Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.InvalidOperationException : xxx is not supported. #196

Open
serard-bimandco opened this issue May 13, 2024 · 2 comments
Open

System.InvalidOperationException : xxx is not supported. #196

serard-bimandco opened this issue May 13, 2024 · 2 comments

Comments

@serard-bimandco
Copy link

serard-bimandco commented May 13, 2024

Hello,

.net 8

I have a solution with an API .Api project with all the DTOs within, with [TranspilationSource] on them.
It works well.

I have put all my DTOs within another project, .Core (with relevant package refs relating tapper and typedsignalr) which .Api projects references to.

Now when I run the transpilation process I get an error :

> npx cross-var dotnet tsrts --project ../backend/src/Acme.project.Api/Acme.project.Api.csproj --output $npm_package_config_projectWebApiOutputDirectory/socket/

Start loading the csproj of C:\code\Acme\project-i6\backend\src\Acme.project.Api\Acme.project.Api.csproj.
__________________________________________________
Projet "C:\code\Acme\project-i6\backend\src\Acme.project.Core\Acme.project.Core.csproj" (Compile;CoreCompile cibles) :

C:\code\Acme\project-i6\backend\src\Acme.project.Core\Acme.project.Core.csproj : warning NU1903: Package 'Npgsql' 8.0.2 has a known high severity vulnerability, https://github.com/advisories/GHSA-x9vc-6hfv-hg8c
Génération du projet "Acme.project.Core.csproj" terminée.
__________________________________________________
Projet "C:\code\Acme\project-i6\backend\src\Acme.project.Infrastructure\Acme.project.Infrastructure.csproj" (Compile;CoreCompile cibles) :

C:\code\Acme\project-i6\backend\src\Acme.project.Infrastructure\Acme.project.Infrastructure.csproj : warning NU1903: Package 'Npgsql' 8.0.2 has a known high severity vulnerability, https://github.com/advisories/GHSA-x9vc-6hfv-hg8c
Génération du projet "Acme.project.Infrastructure.csproj" terminée.
Create Compilation...
Add Header...
Transpile Acme.project.Api.Hubs.ConnectedUser...
Transpile Acme.project.Api.Hubs.User...
Transpile Acme.project.Api.Hubs.UserMove...
Transpile Acme.project.Api.Hubs.WithGuidRequest...
Transpile Acme.project.Api.Hubs.Abstractions.IprojectTableHub...
======== Exception ========
System.InvalidOperationException: Acme.project.Core.ApplicationServices.Commits.Abstractions.Columns.Dtos.DisplayColumnCommitRequestDto is not supported.
   at Tapper.DefaultTypeMapperProvider.GetTypeMapper(ITypeSymbol type)
   at Tapper.TypeMappers.TypeMapper.MapTo(ITypeSymbol typeSymbol, ITranspilationOptions options)
   at TypedSignalR.Client.TypeScript.InterfaceTranspiler.WriteParameters(IMethodSymbol methodSymbol, ITranspilationOptions options, SpecialSymbols specialSymbols, CodeWriter& codeWriter) in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript/InterfaceTranspiler.cs:line 266
   at TypedSignalR.Client.TypeScript.InterfaceTranspiler.AddInterface(INamedTypeSymbol interfaceSymbol, SpecialSymbols specialSymbols, ITypedSignalRTranspilationOptions options, CodeWriter& codeWriter) in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript/InterfaceTranspiler.cs:line 104
   at TypedSignalR.Client.TypeScript.InterfaceTranspiler.Transpile(IEnumerable`1 interfaceTypes) in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript/InterfaceTranspiler.cs:line 42
   at TypedSignalR.Client.TypeScript.TypedSignalRCodeGenerator.Generate() in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript/TypedSignalRCodeGenerator.cs:line 38
   at TypedSignalR.Client.TypeScript.App.TranspileCore(Compilation compilation, String outputDir, NewLineOption newLine, Int32 indent, Boolean referencedAssembliesTranspilation, SerializerOption serializerOption, NamingStyle namingStyle, EnumStyle enumStyle, MethodStyle methodStyle, Boolean enableAttributeReference) in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript.Generator/App.cs:line 138
   at TypedSignalR.Client.TypeScript.App.Transpile(String project, String output, NewLineOption newLine, Boolean assemblies, SerializerOption serializer, NamingStyle namingStyle, EnumStyle enum, MethodStyle method, Boolean attribute) in /home/runner/work/TypedSignalR.Client.TypeScript/TypedSignalR.Client.TypeScript/src/TypedSignalR.Client.TypeScript.Generator/App.cs:line 55


It looks like it doesnt know about the DisplayColumnCommitRequestDto class which comes from the (here) .Core project

When I look at the working project, I get this output which shows that DisplayColumnCommitRequestDto has been found and generated before the IprojectTableHub:

Create Compilation...
Add Header...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddColumnBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddColumnBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddColumnsBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddColumnsBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddColumnsBatchCommitSubRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddLinesBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.AddLinesBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.BatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.BatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.DeleteColumnBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.DeleteColumnBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.DeleteColumnsBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.DeleteColumnsBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.UpdateColumnBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.UpdateColumnBatchCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.UpdateLinesBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.UpdateLinesBatchCommitResponseDto...
Add Header...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.EntityDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.EntityValueDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.InternalPutTableBatchCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.ParameterDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.ParameterNatureEnum...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Batch.Dto.Table.PutTableBatchCommitResponseDto...
Add Header...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.ColumnCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.ColumnCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.DisplayColumnCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.DisplayColumnCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.DisplayColumnsCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.DisplayColumnsCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.HideAllColumnCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.HideAllColumnCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.HideColumnCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.HideColumnCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.ReOrderColumnCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Column.Dto.ReOrderColumnCommitResponseDto...
Add Header...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.AddLineCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.AddLineCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.ValueParameterDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.CellValueDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.DeleteLineCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.DeleteLineCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.LineCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.LineCommitResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.NewCellValueDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.NewEntityDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.UpdateLineCommitRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Commit.Abstractions.Line.Dto.UpdateLineCommitResponseDto...
Add Header...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.EntityStreamingResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.ParametersStreamingRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.ParameterStreamingResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.StreamingEntitiesRequestDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.StreamingLinesResponseDto...
Transpile Acme.Project.Web.Api.Domain.ApplicationServices.Streaming.StreamingTable.Abstractions.Dto.ValueStreamingResponseDto...
Add Header...
Transpile Acme.Project.Web.Api.Hubs.ConnectedUser...
Transpile Acme.Project.Web.Api.Hubs.User...
Transpile Acme.Project.Web.Api.Hubs.UserMove...
Transpile Acme.Project.Web.Api.Hubs.WithGuidRequest...
Transpile Acme.Project.Web.Api.Hubs.Abstractions.IProjectTableHub...
Transpile Acme.Project.Web.Api.Hubs.Abstractions.IProjectTableHubReceiver...
Generate TypedSignalR.Client.TypeScript API script...
======== Transpilation is completed. ========
Please check the output folder: C:\code\Acme\Project-i4\frontend\src\services\api\socket\

Can anyone think about what could be the problem ?

Thanks

@serard-bimandco
Copy link
Author

Ok looks like I need tapper to be called with -asm true to transpile referenced classes in referenced assemblies.

How can I do that ?

@nenoNaninu
Copy link
Owner

The tsrts command also supports the -asm true option. Try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants