asp.net mvc - Configure location of static assets in .NET MVC application -
by default, static assets in .net mvc application live in 2 different directories, /content , /scripts. there way configure visual studio's server static assets in other directories?
for instance, if load /css/main.css, need load ~/assets/css/main.css. need set route?
those 2 folders defaults, there's nothing hard-wired in mvc directories. if use url.content, still have specify content folder in path, if that's you're looking for, i.e. url.content("~/context/site.css"). bundler, also, requires specific complete application-relative path.
you can change folders whatever like, long specify references appropriately well.
the thing is sort of hard-wired nuget packages have associated css , js files. has more developers, though. since content , scripts default directories, nuget package developers set these folders ones dump associated files into. so, if move new folder assets, next nuget package install, recreate content , scripts folders , dump files there. now, there's nothing preventing manually moving files preferred location, it's going old quick deal package updates , such.
i've found easier on , use default directories, said, there's absolutely nothing hard-wired in system force that. understand, you'll have manually rearrange things time time keep sorted way like.
Comments
Post a Comment