T4MVC / R4MVC

R4MVC is a Roslyn code generator for ASP.NET Core MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places
Apache License 2.0
157 stars 48 forks source link

Added management of views generation when the files are linked from another project #127

Open jeromep01 opened 5 years ago

jeromep01 commented 5 years ago

This ability has been added because we are converting a ASP.NET MVC 5 project working with T4MVC in a new format ASP.NET Core project.

As i use the views/controllers in a LinkBase mechanism, R4MVC was generating the controllers correctly but not the Views.

Additionaly i deactivated in the GenerateCommand (sorry, it was included in the Commit), the foundErrors because we have some nuget packages that are not yet fully compliant in .NET Core, and if we have this, the .generated files are not saved. Perharps, we should add a new setting to apply it ?

artiomchi commented 5 years ago

Hey Jerome,

That's a good idea, but needs a bit of work.

I've reverted some of the changes that you had, as one of them broke the model handling code, and the path you added to the tools' project startup didn't exist anywhere except your machine - that shouldn't have been pushed to git :)

I've added a folder with a linked view to the sample project, and the code you added doesn't work in this case. Looking further, this looks like it needs a bit of a more complex change to make this work.

I'll see if I get some time to help on this