frhagn / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
536 stars 132 forks source link

.NET 5: Model not generated if library is a dependency #340

Open ZellC opened 3 years ago

ZellC commented 3 years ago

My project structure is as following:

-- WebApplication -- WebInterface -- Model

In my WebApplication I have a reference to WebInterface and a dependent reference to model. Under WebApplication the dependencies looks like this: Dependencies -- Projects ---- WebInterface ------ Model

My Model.tst in WebApplication doesn't generate any file located in Model library. If I add Model manually the .ts files are generated but the dependencies show me a warning because the model is used twice.

Does anyone have a solution for this issue? Thank you

rhoadsce commented 2 years ago

Did you ever find a solution to this? I'm having a similar issue.

Thanks!

AdaskoTheBeAsT commented 2 years ago

did you tried attaching tst file in model library?

rhoadsce commented 2 years ago

I'm not sure I understand what you mean by "attaching".

I want to keep my tst file in my web project. The hierarchy looks like this:

Web Project -> Library1 -> Library2 -> Domain Library (contains my model)

Models that are in the web project or Library1 are getting picked up by the tst file in the web project. Models in Library2 and the Domain Library are not.

Thanks!

ZellC commented 2 years ago

I got found a solution for this issue.

In your .tst File you can define a Template Constructor with a Settings-Paramater. With this settings you can include your Model-Library to the .tst File.

Template(Settings argSettings) {
    argSettings.IncludeProject("Model");
}

This solution worked for me. I hope I could help you.