Issue with views in plugin

May 16, 2014 at 12:42 PM
I made sure they were embedded but I am still getting this error from the main site

Server Error in '/' Application.

The partial view 'Manage' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Manage.aspx
~/Views/Account/Manage.ascx
~/Views/Shared/Manage.aspx
~/Views/Shared/Manage.ascx
~/Views/Account/Manage.cshtml
~/Views/Account/Manage.vbhtml
~/Views/Shared/Manage.cshtml
~/Views/Shared/Manage.vbhtml

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The partial view 'Manage' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Manage.aspx
~/Views/Account/Manage.ascx
~/Views/Shared/Manage.aspx
~/Views/Shared/Manage.ascx
~/Views/Account/Manage.cshtml
~/Views/Account/Manage.vbhtml
~/Views/Shared/Manage.cshtml
~/Views/Shared/Manage.vbhtml

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The partial view 'Manage' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Manage.aspx
~/Views/Account/Manage.ascx
~/Views/Shared/Manage.aspx
~/Views/Shared/Manage.ascx
~/Views/Account/Manage.cshtml
~/Views/Account/Manage.vbhtml
~/Views/Shared/Manage.cshtml
~/Views/Shared/Manage.vbhtml]
System.Web.Mvc.PartialViewResult.FindView(ControllerContext context) +369144
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +121
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) +242
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
1 filters, ActionResult actionResult) +177
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +89
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
System.Web.Mvc.Async.WrappedAsyncResult1.End() +57
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +62
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult1.End() +62
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +62
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514928
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446
Coordinator
May 16, 2014 at 9:54 PM
Make sure your View folder is capitalized properly, as well as the capitalization of the view. Using embedded resources makes those things case sensitive. Also, make sure your dll is referenced by the web site or somehow the dll is making it into the bin folder of the site.

Is your controller action getting called? You should be able to put a break point in the controller action.
May 19, 2014 at 1:26 PM
I tracked the issue back to a DLL called PluginDemo. Looks like this works with the SetupAppFramework. I ended up rewriting it for my needs and called it loader. This now allows me to get to the views however, they are not resolving System.Web.MVC. Things like ViewBag and ViewData are not working. I checked the web config and it seems correct from everything I read. My question is would the plugin view folder also require a web.config or is the single one in the main site ok?
Coordinator
May 19, 2014 at 8:23 PM
The only required web.config is the one used directly in the web site project that is using the framework. A view contained in a plugin folder can contain anything that a view in the main web site project can contain. The main issue to look out for is the header portion of the cshtml.

The following shows this:
@using System.Web.Mvc
@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using ScoutingPlugin.Models
@inherits System.Web.Mvc.WebViewPage<ScoutingObservation>
Also note that intellisense in the plugin project cshtml will not work properly. Visual Studio will show odd errors in the editor but the view will run fine if it really has no errors. This is one of the biggest pains of using the plugin framework.