lundi 27 juin 2016

Stripping a C# app down to its static web app

We are separating our front end from our back end (C#.NET MVC) so that back-end dev does not block front-end. Instead of a zillion local database updates, I'll be hitting an API.

I've been working in VS up till now, but wish to work in another editor, and be able launch the front-end in a browser directly.

Except that the index page is index.cshtml. There's nothing of note in the index file that requires it to be cshtml, so I could convert it to .html - the only problem is, now launching the app in VS fails because it is only looking for a cshtml file to start, i.e.:

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
etc.

My question is: what can I do to modify index.cshtml or the server, so that I can load the app in a browser without having to run it through Visual Studio?

This is the current structure in VS, most of which I hope to dispense with:

App.Data.EntityFramework
App.Data.Sql
App.Domain
App.DomainEntities
App.Presentation.Web
    App_Data
    App_Start
    Areas
    Content
        CSS
        js
            apps
            dashboard
                controllers
                views << dashboard files
            store  << 90% of my files are here
                controllers
                views
                services
                etc.
    Controllers
    ControllersApi
    Models
    Providers
    Results
    Views
        Home
            index.cshtml << actual start page

This is where I go to start the app:

https://localhost:44337/#/dashboard




Aucun commentaire:

Enregistrer un commentaire