Open Closed

How can i enable Attribute routing and conventional routing MVC core application #6993


0
instaemi created

I added below statement to enable the attribute routing in startup.cs class, but it is not working. is there anything i need to add in Configuration in ABP freamwor?

app.UseMvc();


6 Answer(s)
  • 0
    aaron created

    How are you specifying attribute routing?

  • 0
    instaemi created

    just added the below Route in action

    [Route("UserPersonaldata")]

  • 0
    maliming created

    hi @instaemi Can you provide steps to reproduce the problem?

  • 0
    ryancyq created

    If you want to use it on application service, it is not supported for attribute routing.

    see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3770

  • 0
    instaemi created

    My applcation is ASP.NET Zero MVC core web application . solution is xxx.xxx.Web.MVC

    I have added app.UseMvc(); in startup.cs class and then added the below routing attribute to action method in control to return the Model and view.

    [Route("UserData")] public IActionResult UserPersonal() {

        }
        when i run the application the action is not finding .
        not sure ASP.NET Zero MVC core support attribute routing or not
    
  • 0
    maliming created

    I can't seem to reproduce your problem. Can you use the Demo project to reproduce and share it?

    liming.ma@volosoft.com