I have just created an ASP.NET MVC 4 project and used Visual Studio 2012 RC to create a Controller and Razor Views for Index and Create Actions.
good luck...
When i started using MVC4 recently i faced the above issue while creating a project with the empty templates. Steps to fix the issue.
TOOLS --> Library Package Manager --> Packager Manager Console
Paste the below command and press enter
Install-Package Microsoft.AspNet.Web.Optimization
Note: wait for successful installation. <namespace="System.Web.Optimization" />The Package mentioned in step 1 will add few system libraries into the solution references like System.Web.Optimization is not a default reference for empty templates in MVC4.
I hope this helps. Thank you
I solve this problem in MvcMusicStore by add this part of code in _Layout.cshtml
@if (IsSectionDefined("scripts"))
{
@RenderSection("scripts", required: false)
}
and remove this code from Edit.cshtml
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
Run the program inshallah will work with you.
I ran into this problem, however while running the command:
Install-Package -IncludePrerelease Microsoft.AspNet.Web.Optimization
I received the cryptic message (gotta love a great pun before the first cup of coffee):
Install-Package : The specified cryptographic algorithm is not supported on this platform.
I am running this on Windows XP SP3 (not by choice) and what I found was that I had to follow the instructions posted by the user artsnob on the ASP.NET Forum
Once I ran this I could then run the command line to update the Web.Optimization.
Hope this saves someone some digging.
I had the same issue:
The System.Web.Optimization version I was using was outdated for MVC4 RC.
I updated my packages using the package manager in VS 2010.
In this MSDN blog, Mr. Andy talks about how to update your MVC 4 Beta project to MVC 4 RC. Updating my packages got the Scripts (particularly the web optimization one) to resolve for me:
To install the latest System.Web.Optimization package, use Package Manager Console (Tools -> Library Package Manager -> Package Manager Console) and run the below command:
Install-Package -IncludePrerelease Microsoft.AspNet.Web.Optimization
Use the System.Web.Optimization file included in the package in your references.
To update other packages: Tools menu -> Library Package Manager -> Manage NuGet Packages for Solution.
Apparently you have created an 'Empty' project type without 'Scripts' folder. My advice -create a 'Basic' project type with full 'Scripts' folder.
With respect to all developers.