reinforced / Reinforced.Typings

Converts C# classes to TypeScript interfaces (and many more) within project build. 0-dependency, minimal, gluten-free

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are SDK Projects supported?

martinkoslof opened this issue · comments

I am looking at Reinforced.Typings as a simple Typescript DTO converter for our C# POCOs. Reading the documentation, everything seems straight forward, but I must be missing something. The environment

  • .Net 6
  • Visual Studio 2022 and we have a Azure DevOps CI/CD process using dotnet
  • All csproj are modern SDK projects, i.e. <Project Sdk="Microsoft.NET.Sdk.Web">

I have installed the Reinforced.Typings nuget package:

<PackageVersion Include="Reinforced.Typings" Version="1.6.2" />

I have my Reinforced.TypeSettings.settings.xml file in the project root. When I reference the nuget package I see the Build Files and the Reinforced.Typings.targets.

However, when I do a build nothing happens. Upon further review I believe the problem is the targets file is not compliant. Instead of using this:

<RtSettingsXml Condition="HasTrailingSlash('$(ProjectDir)')">$(ProjectDir)Reinforced.Typings.settings.xml</RtSettingsXml>

The variable to use is this $(MSBuildProjectDirectory)

<RtSettingsXml Condition="HasTrailingSlash('$(MSBuildProjectDirectory)')">$(MSBuildProjectDirectory)Reinforced.Typings.settings.xml</RtSettingsXml>

I am not sure how to proceed. Given, the point is to use the nuget package and have the build run unattended. I can not manually go in and update the target file and I need the tasks to reference the nuget folder on the build server as well.

<UsingTask TaskName="Reinforced.Typings.Integrate.RtCli" AssemblyFile="$(RtTargetsPath)\Reinforced.Typings.Integrate.dll" />

Is my only option to hand edit this file, remove the nuget reference and store the dlls locally in the solution? Am I missing something obvious here?

Bleh. Nevermind, I found the problem I beleive. It seems to be working as intended now. Thanks

I am having the same issue. @martinkoslof, do you remember what you had to do?

Ah, I figured out my issue: I'm using Linux with only .NET 3.1, 6 and 7 installed, but the dotnet CLI tool defaults to using netcoreapp2.2, so the tool fails to run. Setting the framework version in Reinforced.Typings.settings.xml fixed the problem for me.