【发布时间】:2016-04-25 23:55:19
【问题描述】:
我正在尝试将自定义的纯 ASP.NET MVC 应用程序部署为我的 Umbraco 7 站点根目录下的虚拟目录“应用程序”。但是,我总是收到以下 YSOD 错误:
Server Error in '/DemoApp' Application.
Could not load file or assembly 'Umbraco.ModelsBuilder' or one of its dependencies. The system cannot find the file specified.
我也从头开始尝试过,以消除尽可能多的变量。以下是重现步骤:
- 创建了一个全新的空 ASP.NET 解决方案/项目
- 添加了 UmbracoCms nuget 包 (7.4.3)
- 构建解决方案
- 设置我的 IIS 站点 - “UmbracoDemo”,主机名为
umbraco-demo.local - 浏览到
http://umbraco-demo.local并运行 Umbraco 安装程序
注意:到目前为止,一切都按预期工作。我可以登录后台或浏览新的 Umbraco 网站..
- 在名为“DemoApp”的新 VS 解决方案中创建了新的 ASP.NET MVC 应用程序
- 构建新解决方案并立即使用 IIS Express 运行它 - MVC 应用程序正常运行
- 在 IIS 管理器中,我右键单击我的 UmbracoDemo 站点并添加了一个名为“DemoApp”的“应用程序”,将其指向 DemoApp MVC 项目目录
- 在 Umbraco 的 web.config 中的
umbracoReservedPaths设置中添加了“~/DemoApp” - 浏览到
http://umbraco-demo.local/DemoApp
我再次收到错误:
Could not load file or assembly 'Umbraco.ModelsBuilder' or one of its dependencies. The system cannot find the file specified.
其他信息:
我认为这与 ModelsBuilder 没有特别的关系。为了看看会发生什么,我将它添加到我的“DemoApp”web.config 中:
<assemblies>
<remove assembly="Umbraco.ModelsBuilder" />
</assemblies>
现在错误消息显示:
Could not load file or assembly 'UrlRewritingNet.UrlRewriter' or one of its dependencies. The system cannot find the file specified.
所以很自然,我尝试添加:
<remove assembly="UrlRewritingNet.UrlRewriter" />
但这没有影响,错误仍然存在。在另一个例子中,错误提到了一个不同的程序集而不是UrlRewritingNet.UrlRewriter。
【问题讨论】:
标签: asp.net-mvc umbraco