‘object’ does not contain definition for ‘PropertyName’ when using Razor and dynamic objects

If you are trying to pass anonymous dynamic objects to a Razor view you will run into this error. That is because as of C# 5.0 anonymous dynamic objects are compiled as internal.

Considering that views are compiled into a completely separate assembly from controllers, by the time your view model is reaching Razor it just simply won’t have visibility of it, reason why you get the error. so in a nutshell, for now:

Dynamic anonymous objects are not supported by the default MVC engine. 

you can always hack around it by doing casts to ExpandoObject and other tricks, however, my recommendation is to change your code to use a named class so you’re not putting in workarounds which may (and probably and hopefully will) become obsolete with future versions for the framework.

Handler “PHP55_via_FastCGI” has a bad module “FastCgiModule” in its module list

If you get this message when trying to run a PHP web app on IIS it is very likely that you have installed the PHP module using web platform installer but have forgotten to turn the CGI windows feature on in your OS configuration.

so go to control panel -> Programs And Features -> Turn windows features on/off -> Internet Information Services -> World Wide Web Services -> Application Development Features

and finally tick CGI. right here:

php cgi error

Could not load file or assembly ‘System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies

If you are getting this pesky error on a message box every time you fire up VS 2012 with an ASP.Net MVC 5 project most likely it means that you haven’t updated your environment to Update 4.

Whilst everything will work just fine and doing this won’t affect the actual running of the site, VS 2012 will remain confused until you upgrade which will apply the necessary fix.