asp.net mvc - @Styles.Render & @Scripts.Render won't work in Empty MVC Visual Studio solution -
if create solution mvc 5 template in vs 2015 - bundling & minification works fine.
if create solution empty template folders , core references mvc - bundling & minification won't work.
these not work in razor view:
@styles.render("~/content/css") @scripts.render("~/bundles/modernizr")
(error: name 'styles' not exist in current context).
i have tried installing nuget package - doesn't help:
install-package microsoft.aspnet.web.optimization
any references in google appear apply older versions, , above nuget package.
how supposed add bundling & minification project doesn't have it? there different nuget package or something?
first need ensure have reference system.web.optimization
in web project styles
static class exists. after need ensure namespace available in views. this, edit web.config
in views
folder , add namespace
<system.web.webpages.razor> <pages> <namespaces> .... <add namespace="system.web.optimization"/> ^^^^^^^^^^^^^^ add line ^^^^^^^^^^^^^ </namespaces> </pages> </system.web.webpages.razor>