SF search in ~/Views for *.cshtml files intead of ~/MVC/Views
I am running into this issue from time to time ... both if the widgets are in an external project/assembly (with the *.cshtml marked as embed) and creating SF widgets in the MVC folder of the SitefinityWebApp ...................
I get a run time error that cannot find the views under the regular Mvc "Views" folder even though they are under Mvc/Views
For the time being I am just duplicating what is in Mvc/Views to Views .... and feedback would be appreciated as this defeats the purpose of keeping the widgets in an external assembly
~/Views/LogoBar/Default.cshtml
~/Views/Shared/Default.cshtml
~/Views/LogoBar/Default.aspx
~/Views/LogoBar/Default.ascx
~/Views/Shared/Default.aspx
~/Views/Shared/Default.ascx
~/Views/LogoBar/Default.vbhtml
~/Views/Shared/Default.vbhtml
Source : System.Web.Mvc
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Web.Mvc.ViewEngineResult FindView(System.Web.Mvc.ControllerContext)
HResult : -2146233079
Stack Trace : at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at Telerik.Sitefinity.Mvc.ControllerWrapper.Execute()
at Telerik.Sitefinity.Mvc.ControllerActionInvoker.ExecuteController(MvcProxyBase proxyControl)
at Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Routing.FeatherActionInvoker.ExecuteController(MvcProxyBase proxyControl)
We are having the same problem if we add our widgets to the SitefinityWebApp project instead of an external library project
Hi,
Please try adding the ControllerContainer specification to the SitefinityWebApp's AssemblyInfo file as described in the following documentation article: http://docs.sitefinity.com/feather-create-widgets#create-the-custom-model-the-controller-and-the-view
Regards,
Velizar Bishurov
Telerik by Progress
Hi,
I also have this issue and have the line:
[assembly: Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers.Attributes.ControllerContainer]
in AssemblyInfo.cs file.
Can you suggest any other possible solutions?
HI, Can you please provide a bit more details about your case. For example where are the views located - in the SitefinityWebApp or in an external assembly? If they are in an external assembly is their build type set to Embedded resource? Does the external assembly's AssemblyInfo have the ControllerSpecification? Also, if possible, please provide us with the entire error that you are seeing so we can get a bigger picture of the problem. Regards, Velizar
I resolved this issue in my case by fixing the namespace of the MVC controllers. For historical reasons the namespace did not match the expected name for the assembly and this was causing the issue.
Hi, It is good to see you were able to resolve the issue. On a side note it is possible to have controllers in a non-default namespace by registering a custom ViewEngine as described in the following KB article: knowledgebase.progress.com/.../MVC-Add-new-view-engine-to-Sitefinity Regards, Velizar