Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restructuring Default MVC3 Project Directories And NuGet [duplicate]

I once watched a TekPub video on MVC2 that suggested renaming Content folder as Public, Adding Scripts to this folder etc.

A couple of developers I am showing MVC preferred this structure and tried it. However with the inclusion of NuGet it seems to expect the folders to be in the standard locations. E.g. JQuery I think just puts itself in \Scripts folder. Guess that is convention over configuration.

Is there anyway to restructure the default folders but explain to NuGet where to put things? Is it just a bad idea to change the default layout?

like image 679
GraemeMiller Avatar asked Sep 22 '11 23:09

GraemeMiller


2 Answers

The issue is that currently, when you create a package, you specify in the .nuspec file the path that the file will ultimately end up at. So right now, things are pretty much hard-coded to go to /Content.

We've actually discussed adding the ability to specify virtual folders or placeholders in your .nuspec file. Then the end-user can define a mapping to say all $scripts files go to /public/js, etc.

You can see the discussion here http://nuget.codeplex.com/discussions/256542

We can create an issue for this and get people to vote it up.

like image 171
Kiliman Avatar answered Sep 28 '22 15:09

Kiliman


There is no way for Nuget to know where you randomly decided to put stuff. It can't read your mind, and without some kind of configuration, which Nuget doesn't really have for this sort of thing, it simply isn't possible.

This is why you should stick to conventions, because doing so saves you a lot of work if you are ever going to need to utilize third party tools.

like image 41
Erik Funkenbusch Avatar answered Sep 28 '22 15:09

Erik Funkenbusch