Publish .NET MVC to File System

Assuming that SQL Server is installed, SQLExpress will work too, the following shows how to publish an application to a local file folder and make that accessible across the local network. It will also specify an instance of SQL Server, not the default LocalDb. I found this useful to quickly demo a prototype for managers and get their feedback using just the IIS on my computer and our local network. Note that the steps here open up the app to everyone on the network, so it would not be useful if confidential information were involved.

  1. Create the connection string in Web.config
  2. Publish the app to a folder
    Publish App
  3. Assign that folder a name in IIS
    IIS Add Application
    IIS Add Address
  4. Share the folder with Everyone. Navigate to your folder location. Right click it and click Give Access To > Specific People… Select Everyone from the drop down list and click Add, then Share
  5.  Turn on ASP.NET 4.7 (if not already enabled)
    Turn On Features ASP.NET
  6. Create a SQL Login & User with permissions. The username from the connection string needs to be created and granted access or you will be faced with an error: Login failed for user ‘Foo’. Oddly, I found that when using Windows Authentication, the username was the machine and not the user’s domain account.
    Failed to LoginSQL2014 LoginDB UserMapping the User Login should create a User for the DB as well.
    DB UserAnd if it tells you that user you just made cannot login, check the SQL Log. SQL Log

    And continue to troubleshoot.

  7. Enable SQL Server Authentication if not on

    SQL Server Authentication

  8. Now you can navigate to localhost/BookStore
    Create AuthorUntil next time…