Friday, April 29, 2016

Modifying the solution level files in an MVC 6 Project to install a new layout

Leave a Comment

I have an MVC 6 (ASP.NET 5) solution and I would like to have a way to easily "install" a new layout in Visual Studio 2015.

I have the following files

~/Views/Shared/_Layout.cshtml  ~/Views/Shared/{NewLayoutName}/_Header.cshtml  ~/Views/Shared/{NewLayoutName}/_Footer.cshtml  ~/wwwroot/css/{NewLayoutName}.{version}.css ~/wwwroot/css/{NewLayoutName}.{version}.{theme}.css 

An ideal solution would would backup any files that would be overwritten such as the _Layout.cshtml file and would return on an uninstall. Then the files will appear in the installed project. I should be able to create a new MVC 6 app from Visual Studio 2015 and quickly "install this layout."

I tried Nuget and Bower. I'd try Powershell but I hear that's why Nuget doesn't work.

Bower seems to only for client side packages.

I tried using Nuget Package Explorer to create the package and created every variation of folder structures (src, tools, content, "normal" folders, native).

I thought Nuget would be perfect for this but it appears Nuget can't even add css or js to an MVC 6 project. I think this is a Powershell issue.

  1. Nuget's github Open issue #1521
  2. StackOverflow: MVC 6 reference Jquery after adding via Nuget

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment