This is probably a very basic question and there may be a very simple solution, but I cannot seem to be able to use SurfaceController on V9, I get the following error
"Severity Code Description Project File Line Suppression State
Error CS7036 There is no argument given that corresponds to the required formal parameter 'umbracoContextAccessor' of 'SurfaceController.SurfaceController(IUmbracoContextAccessor, IUmbracoDatabaseFactory, ServiceContext, AppCaches, IProfilingLogger, IPublishedUrlProvider)'
"
How does your constructor look? A new thing in V9 is that you need to call the constructor of the base class with the parameters it wants, your constructor should look something like:
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Web.Website.Controllers;
namespace RoutingDocs.Controllers
{
public class MyController : SurfaceController
{
public MyController(
IUmbracoContextAccessor umbracoContextAccessor,
IUmbracoDatabaseFactory databaseFactory,
ServiceContext services,
AppCaches appCaches,
IProfilingLogger profilingLogger,
IPublishedUrlProvider publishedUrlProvider)
: base(umbracoContextAccessor, databaseFactory, services, appCaches, profilingLogger, publishedUrlProvider)
{
}
}
}
SurfaceController
This is probably a very basic question and there may be a very simple solution, but I cannot seem to be able to use SurfaceController on V9, I get the following error
Thank you so much in advance. Mani
How does your constructor look? A new thing in V9 is that you need to call the constructor of the base class with the parameters it wants, your constructor should look something like:
Thank you so much Nikolaj, that solved the issue.
No problem, glad it helped 😀
is working on a reply...