Question

What is the syntax/analogue for Assembly Directive http://msdn.microsoft.com/en-us/library/a7c375wt(VS.71).aspx in MVC 3.0 Razor

On MVC View i have this:

<%@ Assembly Name="Web.Plugins.Authentication" %>

How i may say the same in MVC 3.0 razor view ?

More details and solution:

I did build pluggable MVC application where i am having one Main App and a lot of Plugins in it. All assemblies and views output from Plugins Apps located not in Bin directory of Main App, and in Razor case i was experienced some problems that views cant find model classes.

Finally i did come the solution for that problem. I did make output of all *.dll of Plugins Apps in to Bin Directory of "Main App".

Was it helpful?

Solution 3

In that case all *.dll's should be located in the correct place - in Bin directory of the main project "Main App".

OTHER TIPS

You will not find the equivalent of the Assembly Directive in Razor.

The reason is somewhat convoluted, but it begins with the decision of the MVC team to use WebForms for the first two versions of ASP.NET MVC. WebForms are used for many more things than just views in MVC. What MVC does is simply to re-purpose the WebForms engine to render views.

On the other hand, Razor is a plain view engine. Its objective is to provide a language to describe the rendering of HTML in an MVC website, nothing more.

Perhaps if you detail what you want to achieve we could help you in more detail

Yet another.

web.config
 system.web
  compilation
   assemblies
    add assembly

MVC RazorView class(inherit BuildManagerCompliledView) is using BuildManagerWrapper. If code base change ,implement IBuildManager.GetReferencedAssemblies method and custom WebPage Helper.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top