views:

19

answers:

1

Hey There

I have an MVC Application the views was embedded in the compiled dll, how can i get a list of all the views?

I am using reflection to get all the controller info, however, i do not know the view info.

+1  A: 

When you embed a view file into a project (mark the .aspx file as embedded resource) it is included into the resulting assembly. To obtain a list of all embedded resources you could use the GetManifestResourceStream method to obtain the file as is but I don't really see the usefulness of this technique.

If on the other hand you want to have views embedded into an assembly and instruct the runtime to use those views instead of the file system you might need to implement a custom VirtualPathProvider.

Darin Dimitrov
yup... i got the virtual path provider going... everything works fine, i can call actions on the conpiled assebly by simply throwing the assembly into my bin folder, but i would have liked to be able to scan the assembly for all views and partial views, and maybe get more info on those views
Dusty Roberts
Then you could use the `GetManifestResourceNames` method (http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getmanifestresourcenames.aspx) to enumerate all embedded resources into a given assembly.
Darin Dimitrov
thanx m8, that helped.
Dusty Roberts