Question

When installing the servicestack.razor-package, it transforms the web.config file

<assemblies>
  <add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>

When developing this runs fine, but when I'm deploying the solution to Windows Server 2012, the assembly cannot be found, giving me this error when loading the application:

<assemblies>
   <add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>

Can anyone please give me any insight to how I can get my environment to host my application? Copying this single dll or installing Visual Studio on my server isn't my preferred option.

Thanks!

Was it helpful?

Solution

If System.Web.WebPages.Razor is a dependency that your application needs and it's not in the GAC of your server then you do need to copy that file.

MVC and Razor support are not included in the standard .NET Framework deployment, because they should be deployed as part of the solution.

You could install Microsoft WebMatrix v1 on the server, which should then add that library to the GAC on your server, but to me that seems like overkill when copying should be sufficient.

I would copy System.Web.WebPages.Razor.dll to the bin folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top