Search code examples
c#asp.netpaginationurl-routingrouteconfig

Directory not found error when trying to route to a specific URL


I'm reading Pro Asp.net 4.5 using C# by Adam Freeman I'm stuck where he is adding routes to RouteConfig.cs class in App_Start folder.

When I change

project properties -> Web Tab ->
 Specific Page (Inside Start Action section) -> Specify "list"

and try to test it, it shows directory not found error.

Any of following combinations :

list/2
list/3...

doesn't work

IISExpress/appconfiguration code :

<!-- language: xml -->

    <site name="SportsStoreApplications" id="23"> 
        <application path="/" applicationPool="Clr4IntegratedAppPool"> 
            <virtualDirectory 
                path="/" 
                physicalPath="c:\users\krushank\documents\visual studio 2012\Projects\SportsStoreApplications\SportsStoreApplications" /> 
        </application> 
        <bindings> 
            <binding protocol="http" bindingInformation="*:3079:localhost" /> 
        </bindings> 
    </site>

In short I am trying to route to a specific url "list"

RouteConfig.cs class with routes defined

Link to download the zip : https://www.dropbox.com/s/xsuzd1hua3pdvsq/SportsStoreApplications.zip?dl=0


Solution

  • I started making it again from scratch and i succeded. It was a real horror since yesterday.... feels awesome now! Thanks for all your help

    I recycled IIS Expresss...whole application ...nothing worked else than making it from scratch...

    thanks @RBT and @gmiley for all your help