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

Error MSB6006: "" exited with code 1. #267

Open lukedukeus opened 1 year ago

lukedukeus commented 1 year ago

Attached are two demo projects. The first one (TestDotNetCore) compiles fine, however the second one (TestDotNetCoreWindows) fails with the following error:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB6006 "" exited with code 1.  TestDotNetCoreWindows   C:\Users\Luke\.nuget\packages\reinforced.typings\1.6.2\build\Reinforced.Typings.targets 61  

The only difference in the two projects is that the first one targets net7.0, and the second targets net7.0-windows. I've found that this issue is being caused by the GetProperRtcliPath method in Reinforced.Typings.Integrate, which does not remove the platform identifier, meaning it it looks for rtcli.exe in C:\Users\Luke\.nuget\packages\reinforced.typings\1.6.2\tools\net7.0-windows\rtcli.dll rather than C:\Users\Luke\.nuget\packages\reinforced.typings\1.6.2\tools\net7.0\rtcli.dll (where it is actually located)

You can get around this by setting <RtForceTargetFramework>net7.0</RtForceTargetFramework>, or I've opened a PR which fixes this issue.

lukedukeus commented 1 year ago

Demo projects to reproduce the issue:

ReinforcedTypingsBug.zip

haga-rak commented 8 months ago

The workaround is fine even for .NET 8 but, unlike csproj TargetFramework, you must add the minor version

Not working

<RtForceTargetFramework>net8</RtForceTargetFramework>

Working

<RtForceTargetFramework>net8.0</RtForceTargetFramework>