HelpPage Не найти вид после областей маршрутизации - PullRequest
1 голос
/ 07 октября 2019

мои друзья, я запустил страницу справки Api для моего проекта web api.

Теперь вопрос в том, что после маршрутизации в других областях моя страница справки не может быть найдена index.cshtml. Это код global.asax, и я разместил картинку с сообщением об ошибке

protected void Application_Start()
   {
       GlobalConfiguration.Configure(WebApiConfig.Register);
       FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
       RouteConfig.RegisterRoutes(RouteTable.Routes);
       BundleConfig.RegisterBundles(BundleTable.Bundles);

       AreaRegistration.RegisterAllAreas();

       MvcHandler.DisableMvcResponseHeader = true; /*Version Discloser 5 in 10 point*/
       //Infrastructure.ConnectionStringEncryption.EncryptConnString();
       //GlobalFilters.Filters.Add(new HandleAntiforgeryTokenErrorAttribute() { ExceptionType = typeof(HttpAntiForgeryException) });




   }

введите описание изображения здесь

код моего вспомогательного контроллера:

    public class HelpController : Controller
{
    private const string ErrorViewName = "Error";

    public HelpController()
        : this(GlobalConfiguration.Configuration)
    {
    }

    public HelpController(HttpConfiguration config)
    {
        Configuration = config;
    }

    public HttpConfiguration Configuration { get; private set; }

    public ActionResult Index()
    {
        ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
        return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
    }

    public ActionResult Api(string apiId)
    {
        if (!String.IsNullOrEmpty(apiId))
        {
            HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
            if (apiModel != null)
            {
                return View(apiModel);
            }
        }

        return View(ErrorViewName);
    }

    public ActionResult ResourceModel(string modelName)
    {
        if (!String.IsNullOrEmpty(modelName))
        {
            ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
            ModelDescription modelDescription;
            if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
            {
                return View(modelDescription);
            }
        }

        return View(ErrorViewName);
    }
}

, и моя страница справки здесь: helppage view

...