0

UPDATE1

I've added RazorGenerator and etc...

After set custom tools, I've seen generated code for my razor pages.

Added this code in assembly

public class MyAreaRegistration : AreaRegistration
{

    public override void RegisterArea(AreaRegistrationContext context)
    {
        context.MapRoute("Dictionary_default", "MyDictionary/{Action}/", new { controller = "DictionaryControllerBase", action = "Index" });
    }

    public override string AreaName
    {
        get { return "MyDictionary"; }
    }

    #endregion
}

But when I open page by url /MyDictionary, i see "Unable to find the resource."

NOTE I use in my project MVC3 and Spring.Net


I use one controller (base controller) in another Assembly with razor pages.

In my project I make controller inherited from base controller, just it make some settings. But razor pages I wish to use from assembly.

How can I do it?

SergSW
  • 238
  • 2
  • 10
  • I've found solution my problem. I just remove code MyAreaRegistration. Unfortunately is this case I haven't to have controllers with same names. – SergSW May 23 '13 at 17:12

1 Answers1

1

You could the RazorGenerator extension. I have detailed how this can be achieved in the following post. The idea is that the RazorGenerator extension would create a corresponding .cs file for each Razor view and it will update it every-time you make a change to the corresponding view. This way the Razor views will be precompiled in the class library along with their respective controllers and view models. The RazorGenerator.Mvc NuGet will then register a custom virtual path provider which will take care of resolving those views.

Community
  • 1
  • 1
Darin Dimitrov
  • 960,118
  • 257
  • 3,196
  • 2,876
  • Thank you for answer. I've tried to do by your link, but I have some problems. See update 1 – SergSW May 23 '13 at 09:08