In a program that was working, I started getting the following exception: Activation error occurred while trying to get instance of type IRegionNavigationService
The inner exception is InnerException {"The current type, CommonServiceLocator.IServiceLocator, is an interface and cannot be constructed. Are you missing a type mapping?"} System.Exception {System.InvalidOperationException}
Since this is part of the Prism 6 platform, I'm at a loss as to where to start to fix the problem.
The problem started when I was updating the project from a repository and the solution file became corrupted. I got the program to run, but when I choose an option that navigates to another view I get the exception.
Here is the code that gets the exception:
public class MainMenuViewModel : BindableBase, IRegionManagerAware
{
public IRegionManager RegionManager { get; set; }
public MainMenuViewModel()
{
CustomerProfileCommand = new DelegateCommand(ExecuteCustomerProfileCommand);
AdjustmentTypeCommand = new DelegateCommand(ExecuteAdjustmentTypeCommand);
StreetProfileCommand = new DelegateCommand(ExecuteStreetProfileCommand);
LocationMaintenanceCommand = new DelegateCommand(ExecuteLocationMaintenanceCommand);
}
private void ExecuteLocationMaintenanceCommand()
{
RegionManager.RequestNavigate(RegionNames.ContentRegion, NavigationNames.LocationMaintenance);
}
private void ExecuteStreetProfileCommand()
{
RegionManager.RequestNavigate(RegionNames.ContentRegion, NavigationNames.StreetMaintenance);
}
private void ExecuteAdjustmentTypeCommand()
{
RegionManager.RequestNavigate(RegionNames.ContentRegion, NavigationNames.AdjustmentTypeMaintenance);
}
private void ExecuteCustomerProfileCommand()
{
RegionManager.RequestNavigate(RegionNames.ContentRegion, NavigationNames.CustomerProfile);
}
public ICommand CustomerProfileCommand { get; set; }
public ICommand AdjustmentTypeCommand { get; set; }
public ICommand StreetProfileCommand { get; set; }
public ICommand LocationMaintenanceCommand { get; set; }
}
The RegionManager is instantiated by a region behavior and (using debug to verify) is actually instantiated.
Any direction as to where I should start is appreciated.