Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to serve content from another assembly

How do you put views and content in a separate assembly that can be referenced from a MvcApplication?

like image 680
Svante Svenson Avatar asked Feb 18 '10 18:02

Svante Svenson


People also ask

What is reference assembly?

Reference assemblies are a special type of assembly that contain only the minimum amount of metadata required to represent the library's public API surface.

What is assembly reference in asp net?

NET-based applications. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.


3 Answers

It sounds like you're talking about portable areas. Craig Shoemaker's Polymorphic Podcast had a recent episode featuring Jeffrey Palermo and Eric Hexter, and they discussed portable areas and what they are.

A link to an article at Los Techies appeared in the show notes, which is a great 'how-to' for getting started with working with portable areas.

The short answer is that you need to compile a project with the proper dependencies, and set the build action on all views as embedded resources.

like image 89
John Nelson Avatar answered Oct 19 '22 08:10

John Nelson


AFAIK, there isn't a straight forward way using webforms (.aspx) as the view. However you can use other view engines (for example Stringtemplate) and embed the pages and images as resources into the dll. You will need to implement:

  • Your own view engine
  • Image and other resource (css, js etc.) serving controllers

Hope it makes sense...

like image 41
ziya Avatar answered Oct 19 '22 10:10

ziya


quite simple, when you handle your routing -> route it to the assembly and class that handles this.

but don't forget you have to implement a few things there. i assume you got this figured out.

like image 42
Yuki Avatar answered Oct 19 '22 08:10

Yuki