且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法加载文件或程序集"System.Web.Razor"或其依赖项之一

更新时间:2021-11-15 01:40:34

解决此问题的方法很多:

Quite a few ways to fix this:

  1. 在Web服务器上安装MVC(并非总是可能的.).

  1. Install MVC on the web server (which is not always possible).

在Visual Studio中,您可以将dll设置为在构建时复制到本地,请参阅以下文章(请注意,MVC dll的名称已稍有更改,但这为您提供了过程) http://haacked.com/archive/2008/11/03/bin-deploy- aspnetmvc.aspx

In visual studio you can set dlls to copy to local on build, see the following article (please note MVC dlls have changed names slightly but it gives you the process) http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx

将GAC中的相应dll复制到umbraco站点的bin文件夹中. 为此,请在资源管理器中打开%windir%\ Microsoft.NET \ assembly \ GAC_MSIL",您会发现GAC中安装了所有dll,并且可以将适当的版本复制到您的项目中.这与上述方法类似,但绕过了构建项目的过程.

Copy the appropriate dlls from your GAC into the bin folder of the umbraco site. To do this open "%windir%\Microsoft.NET\assembly\GAC_MSIL" in explorer and you will find all of the dlls installed in the GAC and you can copy the appropriate versions into your project. This is similar to the above method but bypasses building the project.

就文件而言,您可能不仅需要System.Web.Razor.dll,还可以处理所有丢失的文件.

In terms of files you will likely need more than just System.Web.Razor.dll however this will work for all of the missing files.