Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi

When Iam adding bundles in my mvc4 project in the bundlesConfig.cs file .Iam getting the following error with the code


public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
// shared scripts

bundles.Add(new ScriptBundle("...").Include....);
}
}

I am not getting ScriptBundle in my code...It is asking for a new class or type...

Kindly help in this regards

Thanks in advance
Posted

1 solution

In my ASP.Net project to get this class available in my page i need to do two things like :-

Add reference to System.Web.Optimization DLL
then add the namespace to top of the page like :-
C#
using System.Web.Optimization;


Now the 'ScriptBundle' class is available in my page.


In MVC what i think you have to install Microsoft.AspNet.Web.Optimization package from Nuget.
Hope this link will be of help to you :-

http://stackoverflow.com/questions/9475893/how-to-add-reference-to-system-web-optimization-for-mvc-3-converted-to-4-app[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900