.netasp.net-mvcreinforced-typings

Why is Reinforced.Typings completely ignoring the xml configuration file?


I'm trying to use Reinforced.Typings in an old maintenance MVC app to get view model schema to TypeScript.

The problem is that no changes in Reinforced.Typings.settings.xml are having any affect, whatsoever. It's like the default settings in that file are used no matter what I do. I've reproduced this with a vanilla MVC project created by VS2017 (.NET Framework 4.6).

e.g. 1. if I change <RtTargetFile>$(ProjectDir)Scripts\project.ts</RtTargetFile> to <RtTargetFile>$(ProjectDir)Scripts\foo.ts</RtTargetFile>; then project.ts is still created, and foo.ts is not.

e.g. 2. if I set <RtDivideTypesAmongFiles>true</RtDivideTypesAmongFiles> and set <RtTargetDirectory>$(ProjectDir)Scripts\MyApplication</RtTargetDirectory> no files/folders in Scripts\MyApplication are created, and project.ts is still created.

I downloaded the sample solution from the latest github master1, and I can make changes in that xml file and they work. However the DLL version used there (1.3.5) is not available on nuget.

I have reproduced this with the following versions marked with *:

Surely someone would have noticed this if it's an actual bug? I'm thinking it's me, not you! What am I doing wrong? Many thanks in advance!

[Aside: the developer says he can be contacted on Twitter @MurcielagoCat, but that account doesn't seem to exist)


Solution

  • In order to fix that, first of all please make sure that you have rebuilt your project. Due to specifics of MSBuild's C# build tasks, it won't actually trigger build if no source files changed. So in order to completely be sure - navigate to any of your .cs source files and e.g. add empty line at the end, then Rebuild your project.

    If it does not help - then it might be that you are using really outdated MSBuild version that caches build scripts. In this case change your Reinforced.Typings.settings.xml, then close and reopen VisualStudio. Reinforced.Typings.settings.xml is not presumed to be changed very often, so in particular case this activity would not take much time. Anyway, in this case consider building your project from command line (console MSBuild) in order to save time opening/closing VS.