+1-888-365-2779
Try Now
More in this section

Forums / Project Feather / SF search in ~/Views for *.cshtml files intead of ~/MVC/Views

SF search in ~/Views for *.cshtml files intead of ~/MVC/Views

7 posts, 0 answered
  1. Tigger
    Tigger avatar
    17 posts
    Registered:
    25 Apr 2016
    05 Jul
    Link to this post

    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)

  2. Max
    Max avatar
    2 posts
    Registered:
    11 May 2016
    07 Jul
    Link to this post
    We are having the same problem if we add our widgets to the SitefinityWebApp project instead of an external library project
  3. Velizar Bishurov
    Velizar Bishurov avatar
    143 posts
    Registered:
    01 Dec 2016
    11 Jul
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Web Team
    Web Team avatar
    1 posts
    Registered:
    16 Jul 2013
    21 Jul
    Link to this post

    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?

  5. Telerik Admin
    Telerik Admin avatar
    188 posts
    Registered:
    02 Oct 2004
    26 Jul
    Link to this post
    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
  6. Web Team
    Web Team avatar
    1 posts
    Registered:
    16 Jul 2013
    28 Jul
    Link to this post
    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.
  7. Telerik Admin
    Telerik Admin avatar
    188 posts
    Registered:
    02 Oct 2004
    28 Jul
    Link to this post
    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: http://knowledgebase.progress.com/articles/Article/MVC-Add-new-view-engine-to-Sitefinity Regards, Velizar
7 posts, 0 answered