1

使用我的 Visual Studio 2012,nopcommerce 3.0 的二进制版本没有问题。但是在生产环境中,首页显示如下错误:

未找到视图“Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo”或其主视图,或者没有视图引擎支持搜索的位置。搜索了以下位置:~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views .WidgetsNivoSlider.PublicInfo.vbhtml ~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views .WidgetsNivoSlider.PublicInfo.vbhtml ~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo。vbhtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/WidgetsNivoSlider /Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/Shared/Nop.Plugin .Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:在当前网络请求的执行过程中发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views。 WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo。 cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:在当前网络请求执行过程中发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views。 WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo。 cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:在当前网络请求执行过程中发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。cshtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views /WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop .Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:在当前网络请求的执行过程中发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。cshtml ~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views /WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop .Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:在当前网络请求的执行过程中发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration /Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:期间发生未处理的异常当前网络请求的执行。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。vbhtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml ~/Administration /Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:期间发生未处理的异常当前网络请求的执行。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:一个当前 Web 请求执行期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。vbhtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml 描述:一个当前 Web 请求执行期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.InvalidOperationException:未找到视图“Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo”或其主视图,或者没有视图引擎支持搜索的位置。搜索了以下位置:~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views .WidgetsNivoSlider.PublicInfo.vbhtml ~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views .WidgetsNivoSlider.PublicInfo.vbhtml ~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml ~/Views/WidgetsNivoSlider/Nop.Plugin。

源错误:

第 3 行:@foreach(模型中的 var 小部件)第 4 行:{ 第 5 行:
@Html.Action(widget.ActionName, widget.ControllerName, widget.RouteValues) 第 6 行:}

请问有什么建议吗?

4

2 回答 2

1

我遇到了同样的问题。即使帖子很旧,但我认为答案可以帮助其他人。这是问题的解决方案。

当我们在选择预编译选项的情况下发布项目时出现错误。如果您在没有预编译的情况下发布项目,您将不会遇到此问题。因为当我们在发布时启用预编译时,有些嵌入式视图无法正常工作。

于 2014-07-18T07:21:04.557 回答
0

这看起来像是发布错误。看起来您已经有了视图并且它们在您的计算机上正常工作,但是在服务器上它缺少一些没有被推送到您的 FTP、Web 发布或您正在使用的其他部署形式的文件。

试着回答这些问题,我很肯定你会找到罪魁祸首:

  • 如果您能够远程桌面到您的服务器,您可以验证文件是否存在?
  • 您使用的是哪种发布配置文件?您是否尝试过在本地发布并验证该文件是否存在于那里?
  • 如果 nopCommerce 是使用 nuget 包添加的,您是否确保将文件包含在源代码管理下?
  • 这只是您的工作站上的问题吗?或者你的任何同事有同样的经历吗?
于 2013-06-22T14:56:16.197 回答