Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC folder structure and NuGet

I want a custom directory structure for my Content in my MVC project for example:

\Content     --\js     --\css     --\img 

Is it possible to tell a NuGet package to install scripts in the Content\js folder? For example the jQuery package so that the jquery-1.6.js file is installed in the Content\js folder?

like image 922
adriaanp Avatar asked Jun 23 '11 07:06

adriaanp


People also ask

What is the folder structure of ASP.NET MVC?

The Views folder contains a subfolder for each Controller and Views for the Controller action results. The View's sub folder is named with the controller-name-prefix and View is named with the controller action. The Views folder contains a Web. config file.

What is the App_Start folder in ASP.NET MVC?

The App_Start folder of MVC application is used to contain the class files which are needed to be executed at the time the application starts. The classes like BundleConfig, FilterConfig, IdentityConfig, RouteConfig, and Startup. Auth etc. are stored within this folder.

What goes in the App_Data folder?

App_Data contains application data files including . mdf database files, XML files, and other data store files. The App_Data folder is used by ASP.NET to store an application's local database, such as the database for maintaining membership and role information.

What is NuGet in ASP.NET MVC?

NET and Visual Studio. NuGet can be used to find and install packages, that is, software pieces and assemblies and things that you want to use in your project. NuGet is not a tool that is specific to ASP.NET MVC projects.


2 Answers

A workaround is to use the Nuget Package Explorer and download the package you want into that. You can then edit the folders within the package using Package Explorer to suit your taste and save it into your own Nuget repository. This can be a file system folder or you can get more sophisticated here: Hosting Your Own NuGet Feeds.

Of course this means that you have to keep the packages in your private repository up to date. Clearly if you have a lot of packages to deal with this could become a problem. However it seems quite likely that a future release of Nuget will deal with the issue of local feeds because it's an issue for companies that 'restrict which third-party libraries their developers may use' as mentioned in the Hosting your own NuGet feeds reference above.

like image 105
CrispinH Avatar answered Sep 28 '22 06:09

CrispinH


I believe the answer to that is "No." There are, however, some references to be able to set the root folder NuGet installs things into: http://nuget.codeplex.com/workitem/215 (see the comments)

like image 21
Chris Breish Avatar answered Sep 28 '22 08:09

Chris Breish