Stephen Brannan - 110 - Apr 11, 2014

I’m having trouble deploying ServiceStack with Razor to Azure as a web role. I get the following error…

Could not load file or assembly ‘System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

and it’s referring to this line…
          <add assembly=“System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35” />

But per the Rockstar sample and what’s in my web project is a reference to v3.0.0.0. 

This is mentioned in:

You would need to either change the reference in Razor config to point to the Version= or install the version, i.e:
Install-Package Microsoft.AspNet.WebPages -Version 1.0.20105.408

We don’t actually use the library (it’s there just to keep Web.config happy) so it’s cool to use the older 1.0 version.

Stephen Brannan:

I tried to change the reference to in the config and I got the same error but for I then tried to use both the latest and 1.0.20105.408 WebPages nuget package and when I did this the site comes up with the generic “snapshot servicestack” page. It’s as if I lost my razer pages.

Are there any startup errors in ?debug=requestinfo

Stephen Brannan:

What seemed to work both locally and in azure was removing the line <add assembly=“System.Web.WebPages.Razor, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35” /> completely from the web.config. I still kept the 3.0 as a reference though. You may want to consider revisiting this situation.

I’ll revert it back to 1.0.2x and try the debug=requestinfo tomorrow and see if anything shows up.

hmm, do you mean this line?

I’ll investigate, it would be damn nice not to specify a specific version.

Stephen Brannan:

Yes that’s the line I removed.