How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app

Update Version 1.1.x is available, read the release notes: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization The Microsoft.Web.Optimization package is now obsolete. With ASP.NET (MVC) 4 and higher you should install the Microsoft ASP.NET Web Optimization Framework: Install the package from nuget: Install-Package Microsoft.AspNet.Web.Optimization Create and configure bundle(s) in App_Start\BundleConfig.cs: public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new … Read more

What is the meaning of prepended double colon “::”?

This ensures that resolution occurs from the global namespace, instead of starting at the namespace you’re currently in. For instance, if you had two different classes called Configuration as such: class Configuration; // class 1, in global namespace namespace MyApp { class Configuration; // class 2, different from class 1 function blah() { // resolves … Read more

Unnamed/anonymous namespaces vs. static functions

The C++ Standard reads in section 7.3.1.1 Unnamed namespaces, paragraph 2: The use of the static keyword is deprecated when declaring objects in a namespace scope, the unnamed-namespace provides a superior alternative. Static only applies to names of objects, functions, and anonymous unions, not to type declarations. Edit: The decision to deprecate this use of … Read more

How do I declare a namespace in JavaScript?

I use the approach found on the Enterprise jQuery site: Here is their example showing how to declare private & public properties and functions. Everything is done as a self-executing anonymous function. (function( skillet, $, undefined ) { //Private Property var isHot = true; //Public Property skillet.ingredient = “Bacon Strips”; //Public Method skillet.fry = function() … Read more

Should ‘using’ directives be inside or outside the namespace?

There is actually a (subtle) difference between the two. Imagine you have the following code in File1.cs: // File1.cs using System; namespace Outer.Inner { class Foo { static void Bar() { double d = Math.PI; } } } Now imagine that someone adds another file (File2.cs) to the project that looks like this: // File2.cs … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)