Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be stored in source control for an Asp.Net Core MVC application?

With the new Asp.net Core MVC projects such as:

enter image description here

There are a lot of unfamiliar folders there, like bower_components, wwwroot, Dependencies, etc..

What should be stored in source control?

like image 551
NikolaiDante Avatar asked Feb 15 '16 14:02

NikolaiDante


People also ask

What must the controller be named in ASP.NET MVC and what folder does it have to be specifically saved under?

In ASP.NET MVC, every controller class name must end with a word "Controller". For example, the home page controller name must be HomeController , and for the student page, it must be the StudentController . Also, every controller class must be located in the Controller folder of the MVC folder structure.

Which of the following are asp net core MVC functionalities?

ASP.NET Core MVC provides a patterns-based way to build dynamic websites that enables a clean separation of concerns. It gives you full control over markup, supports TDD-friendly development and uses the latest web standards.

What is role of controller in asp net core MVC?

Learn more at Overview of ASP.NET Core MVC and Get started with ASP.NET Core MVC and Visual Studio. The controller is a UI-level abstraction. Its responsibilities are to ensure request data is valid and to choose which view (or result for an API) should be returned.

Which among the following are main aspects of ASP.NET MVC?

The ASP.NET MVC framework provides the following features: Separation of application tasks (input logic, business logic, and UI logic), testability, and test-driven development (TDD) by default.


2 Answers

Anything that is a project setting, or that you directly change you should store. Anything that is directly downloaded (references, bower/node) or is directly based on those (lib folder getting copied by gulp) should be ignored.

So, in your case, ignore bower, node, and project\wwwroot\lib. You want the wwwroot folder if you have custom css or js.

like image 105
JonTheMon Avatar answered Oct 10 '22 00:10

JonTheMon


I went with

enter image description here

(With green being yes, red being no)

The only unlisted exception was the .xproj (and for TFS the .xproj.vspscc).

I deleted the folder from my local workspace (after backing up to somewhere else) and restored from source control and everything seems to behave as it should, once all the packages restored themselves.

This assumes that the gulpfile.js is configured to move the needed css, js, font components into wwwroot.

Also since I wrote this, there is a launchSettings.json within the properties folder that I've source controlled (Not sure why it's only just generated).


My .tfsignore file is currently:

project\wwwroot
!project\wwwroot\web.config
project\node_modules
project\bower_components

(which seems to be OK so far, but would potentially change if other static resources such as JS, CSS and Images were added in.)

like image 24
NikolaiDante Avatar answered Oct 10 '22 00:10

NikolaiDante