fubumvc

The Web server is configured to not list the contents of this directory


Using Visual Studio 2012:

  1. I created an "ASP.NET Empty Web Application" (using C#).
  2. I used NuGet to install the FubuMVC package.
  3. When I run the application (using IIS Express), I get the "Welcome to FubuMVC!" page which tells me to delete the FubuMVC.GettingStarted.dll file and to set the home page.
  4. So I do both of those things, implementing a HomeController that simply returns "Hello World" from Index.

Rather than the expected "Hello World", I get an IIS error: The Web server is configured to not list the contents of this directory.

What have I done wrong?


Solution

  • Just tried reproducing your problem with a brand new project; it turns out that problem is that the instructions in the example haven't kept up with the changes in FubuMVC.

    The instructions tell you to create a class called 'MyHomeController' and add the Index() method to it. This used to work, because one of the default rules for routes was to use any class with a name that ends in 'Controller'.

    But the default has been changed in more recent versions, and the rule now looks for classes ending in 'EndPoint'.

    So if you change the name of the class from 'MyHomeController' to 'MyHomeEndpoint', it should work.

    Also, remember that the application pool needs to restart for the new configuration to take effect, so you might have to touch your web.config (or force IISExpress to restart).