TypeLITE with multiple projects

I use TypeLITE with various projects and a simple website. I would like to use TypeLITE to generate TypeScript definitions from my C # classes, but I am not allowed to add TypeLITE DLLs to each project.

Let it be my project structure:

Decision
|
|
----- WebSite (with NuGet-installation TypeLITE)
|
|
----- FirstProject
|
|
----- Second project
|
|
----- ThirdProject

I installed TypeLITE through the NuGet-Console, and C # -Classes are in "FirstProject", "SecondProject" and "ThirdProject".

Problem: I have to use NuGet-Installation for all other projects.

Is it possible?

+6
source share
1 answer

If you want to use class definitions from FirstProject to WebSite , you can simply add a link to FirstProject in the TypeLite.tt file inside your WebSite

 <#@ assembly name="$(TargetDir)FirstProject.dll" #> 

and classes from FirstProject will become available for TypeLITE.

(if the FirstProject.dll file is not located in the bin folder of your WebSite , you need to use the appropriate directory instead of $(TargetDir) )

+7
source

Source: https://habr.com/ru/post/970618/


All Articles