Visual Studio 2010: The type or namespace name ‘type/namespace’ could not be found

I recently converted a solution from VS2005 to VS2010. After changing all of my projects to target .NET Framework 4.0, I was plagued with the dreaded CS0246:

The type or namespace name ‘type/namespace’ could not be found (are you missing a using directive or an assembly reference?)

As suggested in the numerous blog posts I found…

  • I verified that all of my projects were targeting the same Framework version (4.0 vs. 4.0 Client Profile).
  • I relaunched Visual Studio (several times).
  • I cleaned and rebuilt (several times).
  • I removed and re-added references.
  • I disabled my one and only add-on (Resharper).

After all of that, it still wouldn’t build.

It turns out that the error was in my config files. Several months ago, we used assembly redirection to resolve some version conflicts:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
      <bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>

As soon as I removed the redirection, all of my projects built successfully.

 

Obamacare Summed Up In One Sentence

So let me get this straight, we’re going to be gifted with a healthcare plan we are forced to purchase, and fined if we don’t, which puportedly covers at least 10 million more people, without adding a single new doctor, but provides for 16,000 new IRS agents, written by a committee whose chairman says he doesn’t understand it, passed by a congress that didn’t read it but exempted themselves from it, and signed by a president who smokes, with funding administered by a treasury chief who didn’t pay his taxes, for which we will be taxed for four years before any benefits take effect, by a government which has already bankrupted social security and medicare, all to be overseen by a surgeon general who is obese and and financed by a country that’s broke.

So what the “blank” can possibly go wrong?

— Dr. Barbara Bellar