ChrisHammond / DNNTemplates

Christoc's DotNetNuke Extension Development templates for Visual Studio
http://www.christoc.com/Products/DNN-Development-Templates
Other
97 stars 38 forks source link

DAL2 MVC Template not working #44

Closed holaneph closed 5 years ago

holaneph commented 7 years ago

I have tried the latest versions of MVC templates on VS2017 Community and VS2015 Pro both giving me these errors when I place the module into a page:

Error: DNNModule1 is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Attempt by method 'Christoc.Modules.DNNModule1.Controllers.ItemController.Index()' to access method 'System.Web.Mvc.Controller.View(System.Object)' failed. ---> System.MethodAccessException: Attempt by method 'Christoc.Modules.DNNModule1.Controllers.ItemController.Index()' to access method 'System.Web.Mvc.Controller.View(System.Object)' failed. at Christoc.Modules.DNNModule1.Controllers.ItemController.Index() in C:\websites\dnndev.me\dnn8\DesktopModules\MVC\DNNModule1\Controllers\ItemController.cs:line 84 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>cDisplayClass15.b12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at DotNetNuke.Web.Mvc.Framework.Modules.ModuleApplication.ExecuteRequest(ModuleRequestContext context) at DotNetNuke.Web.Mvc.MvcHostControl.ExecuteModule() --- End of inner exception stack trace ---

and:

An error has occurred. DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleInstanceContext.LoadActions(HttpRequest request) at DotNetNuke.UI.Modules.ModuleInstanceContext.get_Actions() at DotNetNuke.UI.Containers.ActionBase.OnLoad(EventArgs e) --- End of inner exception stack trace ---

Am I missing something, I've already spent 4 days trying to figure this out. TIA

sdlmedia commented 7 years ago

I have the same Problem !

ChrisHammond commented 7 years ago

Be sure to check your paths, the original post here didn't file the installation instructions and have the website installed in a different location

sdlmedia commented 7 years ago

Thanks, the problem was an NuGet-Update of "Microsoft.AspNet.Mvc" to 5.2.3

jaszb commented 6 years ago

be good if the template could handle the NuGet-Update of "Microsoft.AspNet.Mvc" to 5.2.3 - is this worth logging as a bug/issue?

jaszb commented 6 years ago

best to grab the packages file, open it up and check out the versions used to build the template ie:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.AspNet.Mvc" version="5.1.1" targetFramework="net45" userInstalled="true" />
  <package id="Microsoft.AspNet.Razor" version="3.1.2" targetFramework="net45" userInstalled="true" />
  <package id="Microsoft.AspNet.WebPages" version="3.1.1" targetFramework="net45" userInstalled="true" />
  <package id="Microsoft.web.Infrastructure" version="1.0.0.0" targetFramework="net45" userInstalled="true" />
  <package id="MSBuildTasks" version="1.5.0.235" targetFramework="net45" developmentDependency="true" />
</packages>

then you can adjust your mvc nuget packages to line up with the above.

rocklee9 commented 5 years ago

I have the same problem , I fixed: HomeController : Controller => HomeController : DnnController . hope to help you