这些都不对我有用。  
我的类库肯定都引用了System.Core和Microsoft.CSharp。Web应用程序为4.0,由于支持问题,无法升级到4.5。
我在使用Razor Engine编译剃刀模板时遇到错误,并且只是间歇性地遇到它,就像在重新启动Web应用程序之后一样。
对我有用的解决方案是手动加载程序集,然后重新尝试相同的操作...
        bool retry = true;
        while (retry)
        {
            try
            {
                string textTemplate = File.ReadAllText(templatePath);
                Razor.CompileWithAnonymous(textTemplate, templateFileName);
                retry = false;
            }
            catch (TemplateCompilationException ex)
            {
                LogTemplateException(templatePath, ex);
                retry = false;
                if (ex.Errors.Any(e  => e.ErrorNumber == "CS1969"))
                {
                    try
                    {
                        _logger.InfoFormat("Attempting to manually load the Microsoft.CSharp.RuntimeBinder.Binder");
                        Assembly csharp = Assembly.Load("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
                        Type type = csharp.GetType("Microsoft.CSharp.RuntimeBinder.Binder");
                        retry = true;
                    }
                    catch(Exception exLoad)
                    {
                        _logger.Error("Failed to manually load runtime binder", exLoad);
                    }
                }
                if (!retry)
                    throw;
            }
        }
希望这可以帮助其他人。