reinforced / Reinforced.Typings

Converts C# classes to TypeScript interfaces (and many more) within project build. 0-dependency, minimal, gluten-free
MIT License
507 stars 82 forks source link

Are SDK Projects supported? #256

Closed martinkoslof closed 1 year ago

martinkoslof commented 1 year ago

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

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?

martinkoslof commented 1 year ago

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

iinuwa commented 1 year ago

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

iinuwa commented 1 year ago

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.