I'm adding Microsoft.Web.Optimization to an MVC 4 Beta project.
My _Layout.cshtml:
<script src="@Microsoft.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/Framework/js", true)"></script>
complains
Error 1 The type or namespace name 'Optimization' does not exist in the namespace 'Microsoft.Web' (are you missing an assembly reference?)
However, any .cs file in the project can resolve that type (for example, a controller).
Do I need to do something to inform a .cshtml page about the newly added reference?
Turns out NuGet offered me and old version, 0.1. I'm not sure why that caused this issue, but removing that reference and adding 1.0.0-Pre through NuGet resolved the issue
http://www.nuget.org/packages/Microsoft.Web.Optimization
Note that the namespace has changed to System.Web.Optimization
in this release.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With