Ohh.. I am sorry for incomplete answer earlier. Web optimization framework is introduced with MVC 4. Try with MVC 4 project it is included in default MVC 4 project template.
I am able to use and define Bundle with MVC 3. there might be some other issue with respect to System.Web.Http. System.Web.Optimization was introduced with MVC 4 but I am able to use it with MVC 3 as well. I followed below step.
geetasks
Member
158 Points
170 Posts
Error System.Web.Http namespace not defined
Nov 23, 2012 03:51 AM|LINK
I am working in MVC3. It is not recognizing System.Web.Optimization & System.Web.Http namespace.
Moreover, I am getting error "Type BundleCollection not defined".
How can this be resolved?
Nandip Makwa...
Participant
1267 Points
293 Posts
Re: Error System.Web.Http namespace not defined
Nov 23, 2012 03:56 AM|LINK
This require http://nuget.org/packages/Microsoft.AspNet.Web.Optimization to be installed... is it installed?
Software Engineer by Profession, Learner by Passion!
geetasks
Member
158 Points
170 Posts
Re: Error System.Web.Http namespace not defined
Nov 23, 2012 04:13 AM|LINK
Thanks Nandip for Replying. As explained in the given link, I had run
But still if I build Project it is showing "System.Web.Http namespace not defined".
Nandip Makwa...
Participant
1267 Points
293 Posts
Re: Error System.Web.Http namespace not defined
Nov 23, 2012 04:18 AM|LINK
Ohh.. I am sorry for incomplete answer earlier. Web optimization framework is introduced with MVC 4. Try with MVC 4 project it is included in default MVC 4 project template.
Software Engineer by Profession, Learner by Passion!
geetasks
Member
158 Points
170 Posts
Re: Error System.Web.Http namespace not defined
Nov 23, 2012 04:25 AM|LINK
As suggested by you, I am had installed the same with MVC3. Is there any method to remove error in MVC3.
Nandip Makwa...
Participant
1267 Points
293 Posts
Re: Error System.Web.Http namespace not defined
Nov 23, 2012 04:48 AM|LINK
I am able to use and define Bundle with MVC 3. there might be some other issue with respect to System.Web.Http. System.Web.Optimization was introduced with MVC 4 but I am able to use it with MVC 3 as well. I followed below step.
protected void Application_Start() { Bundle myBundle = new ScriptBundle("~/bundles/CommonJs").Include("~/Scripts/Common.js"); BundleTable.Bundles.Add(myBundle); }Now I am able to browse with ~/bundles/CommonJs with minified JavaScript response same as in MVC 4.
Software Engineer by Profession, Learner by Passion!