AdrianWilczynski / CSharpToTypeScript

Convert C# Models, ViewModels and DTOs into their TypeScript equivalents using webapps, CLI Tool or VSCode extension. Links: https://marketplace.visualstudio.com/items?itemName=adrianwilczynski.csharp-to-typescript - https://csharptotypescript.azurewebsites.net - https://adrianwilczynski.github.io/CSharpToTypeScript/ - https://www.nuget.org/packages/CSharpToTypeScript.CLITool/
MIT License
115 stars 32 forks source link

Support dotnet 5 #19

Open NechiK opened 3 years ago

NechiK commented 3 years ago

Hi, I'm trying to install CLI Tool for net5.0 project, but I'm getting compatibility error.

Restoring packages for .NETCoreApp,Version=v5.0...
Resolving conflicts for net5.0...
Checking compatibility of packages on net5.0.
Checking compatibility for shared-enum 1.0.0 with net5.0.
Checking compatibility for CSharpToTypeScript.CLITool 2.5.1 with net5.0.
Package CSharpToTypeScript.CLITool 2.5.1 is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Package CSharpToTypeScript.CLITool 2.5.1 supports: netcoreapp2.2 (.NETCoreApp,Version=v2.2) / any
Invalid project-package combination for CSharpToTypeScript.CLITool 2.5.1. DotnetToolReference project style can only contain references of the DotnetTool type 
Incompatible packages: 2
Package 'CSharpToTypeScript.CLITool 2.5.1' has a package type 'DotnetTool' that is not supported by project 'shared-enum'.

Is it possible to add support for net5.0? I'm working on converting backend enums and interfaces to TypeScript files. We're going to automate it and add it to the build pipeline in order to keep interfaces and enums the same on both sides.

NechiK commented 3 years ago

Hi @AdrianWilczynski Is there a chance that you will have time to add support for dotnet 5?

AdrianWilczynski commented 3 years ago

I didn't test this, but I was under the impression that it will work on .NET 5 through RollForward setting.

I feel like the issue might be with you trying to add this to a project as a regular NuGet package. You could try installing it globally (dotnet tool install --global CSharpToTypeScript.CLITool) or (if you want to add it to the project) as a local tool: https://andrewlock.net/new-in-net-core-3-local-tools/