T4MVC support for Portable Areas

323 Views Asked by At

What does this in T4MVC.Settings file mean:

// You can list folders containing portable areas here
readonly string[] PortableAreas = new string[] {
    ""

What does it mean "You can list folders containing portable areas here"?

We know that Portable Areas are implemented as separate projects/assemblies and brought in the consuming project via Add Reference so I don't quite understand what is meant with these folders.

I was thinking it means that we have to provide the area folder name for the Portable Area when T4MVC is being used within the area but it doesn't work. Nothing gets generated by T4MVC.

1

There are 1 best solutions below

1
On

I'm not super familiar with the Portable Area feature, and this T4MVC feature was contributed by someone else. If you look at T4MVC.tt, what it does is fairly straightforward: it processes the folders specified in the array the same way it processes regular MVC areas.

Here is what the contributor had written at the time he made the change:

I've modified T4MVC template and settings a little bit to consume this feature (the change seem rather simple for me). Could you please review the patch and if it's ok apply to the project? (or tell me in a couple of words what's wrong with it)

It worked for me both from the portable area project and the main MVC project.

So I think the idea is to use T4MVC.tt in the portable area project directly. If needed, I can hook you up with the contributor, who may have more to say about it.