none
Issue while "Portal" keyword RRS feed

  • Question

  • We are facing a strange issue with Visual Studio 2019 Professional.

    While we are building a C# MVC Web project in Visual Studio Professional 2019 (Ver 16.1.1)

    We are unable to hit a Controller that has routing starting with name "Portal"

    [Route("Portal/Pages/{title}", Order = 1)]

    We get a "404 Error" when we try to hit it.

    The same is working when we build and run the application in Visual Studio Professional 2013 (Ver 12.0.40629.00 Update 5)

    If we change the routing in Visual Studio 2019 from "Portal" to "Portal1" or something, it starts working but "Portal" is not working.

    Project Type:- MVC Web project

    Language:- C#

    Target Framework:- 4.5

    VS 2019:- Visual Studio Professional 2019 (Ver 16.1.1)

    Vs 2013:- Visual Studio Professional 2013 (Ver 12.0.40629.00 Update 5)


    • Edited by Satyam_Dwivedi Tuesday, August 27, 2019 9:08 AM
    • Moved by CoolDadTx Wednesday, September 4, 2019 2:01 PM ASP.NET related
    Tuesday, August 27, 2019 7:12 AM

All replies

  • Hi

    Normally, we will call the signalr hub method in the javascript,  it will not directly return 404 error. Since we will use the javascript client application to connect to the server.  Could you please tell me which is your type for your signalr application?

    If you want to modify the connection timeout, I suggest you could refer to below codes:

    protected void Application_Start(object sender, EventArgs e)
    {
        // Make long polling connections wait a maximum of 110 seconds for a
        // response. When that time expires, trigger a timeout command and
        // make the client reconnect.
        GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(110);
        
        // Wait a maximum of 30 seconds after a transport connection is lost
        // before raising the Disconnected event to terminate the SignalR connection.
        GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(30);
        
        // For transports other than long polling, send a keepalive packet every
        // 10 seconds. 
        // This value must be no more than 1/3 of the DisconnectTimeout value.
        GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(10);
        
        RouteTable.Routes.MapHubs();
    }
    
    

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 28, 2019 8:54 AM
  • Hi,

    It is an MVC Application, We are not using Signal R anywhere.

    There is one Controller Action with Name 

    Portal/Pages

    , Which is working fine when I am building the application in VS2013, but the moment, I build and run the application in Vs2019 it fails and gives 404.

    If I change the controller name from Portal to Portal1, if works in VS2019 build.

    Wednesday, August 28, 2019 9:27 AM
  • Hi Satyam,

    Thanks for the feedback.

    Could you please post the route config about your MVC application? 

    I have created  a test demo on my side and it works well.

    Below is my MVC controller:

        public class RouteTestController : Controller
        {
            // GET: RouteTest
            [Route("Portal/Pages/{title}" ,Order =1 )]
            public ActionResult Index(string title)
            {
                return View();
            }
    }
    

    Result:

    Besides, you could post it in the Asp.net MVC forum.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 28, 2019 9:33 AM
  • Hi, 

    Here is route config

    public static void RegisterRoutes(RouteCollection routes)
            {
                routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
                routes.MapMvcAttributeRoutes();
    
                routes.MapRoute(
                    name: "Default",
                    url: "{controller}/{action}/{id}",
                    defaults: new { controller = "Pages", action = "Index", id = UrlParameter.Optional },
                    namespaces: new [] { "NameSpace" }
                );            
            }

    Wednesday, August 28, 2019 9:57 AM
  • Please post questions related to MVC in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, September 4, 2019 2:01 PM