c# - The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?) -
so, have mvc 4 project in c# , using visual studio web 2012 express.
i cannot compile projecto due error: type or namespace name 'bundlecollection' not found (are missing using directive or assembly reference?)
normally, mean library missing. after making quick search on net used nuget install microsoft.aspnet.web.optimization
, still did not work.
what makes intriguing me bundlecollections should known application deafult. can imagine have added dependency messed up, can't know sure.
how can prepare problem? missing here?
code:
using system; using system.web; using system.web.optimization; namespace dockis { public class bundleconfig { // more info on bundling, visit http://go.microsoft.com/fwlink/?linkid=254725 public static void registerbundles(bundlecollection bundles) { iitemtransform cssfixer = new cssrewriteurltransform(); bundles.add(new scriptbundle("~/bundles/jquery").include( "~/scripts/jquery-{version}.js")); //... } } }
edit
after checking references folder tried running command install-package system.web.optimization
, cannot install package. next error:
install-package : 1 or more errors occurred. @ line:1 char:16 + install-package <<<< system.web.optimization + categoryinfo : notspecified: (:) [install-package], aggregateexception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand
what odd, fact running install-package system.web.optimization.less
works, , fixes depencie problems, not of them. believe need first command work.
what doing wrong?
there no clear reply question. managed prepare project re-creating it, , downloading dlls in different order, closing , re-opening visual studio several times while doing it.
aparently there conflict between of packages, impossible guess until had re-created project scratch again.
running install-package microsoft.aspnet.web.optimization
did solve problem after clean install however, recommend it.
i give thanks help.
c# .net asp.net-mvc-4 visual-studio-2012 nuget
No comments:
Post a Comment