Base solution for your next web application
Open Closed

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


User avatar
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)
  • User Avatar
    0
    aaron created
    Support Team

    How are you specifying attribute routing?

  • User Avatar
    0
    instaemi created

    just added the below Route in action

    [Route("UserPersonaldata")]

  • User Avatar
    0
    maliming created
    Support Team

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

  • User Avatar
    0
    ryancyq created
    Support Team

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

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

  • User Avatar
    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
    
  • User Avatar
    0
    maliming created
    Support Team

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

    [email protected]