title: SimpleIoC - Type not found in cache: Windows.UI.Xaml.Controls.Frame
body: <p>I am running into the below error the first time my ViewModel is being instantiated by the SimpleIoC.  I believe I have setup the container as it should be, but for some reason, I am still getting the below error.  Any ideas or assistance would be very much appreciated.</p>
  
  <pre><code>    Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code
    HResult=-2146233088
    Message=Type not found in cache: Windows.UI.Xaml.Controls.Frame.
    Source=GalaSoft.MvvmLight.Extras
    StackTrace:
         at GalaSoft.MvvmLight.Ioc.SimpleIoc.DoGetService(Type serviceType, String key) in c:\Users\Public\Downloads\CodePlex\MVVMLight\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (NET35)\Ioc\SimpleIoc.cs:line 532
         at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetService(Type serviceType) in c:\Users\Public\Downloads\CodePlex\MVVMLight\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (NET35)\Ioc\SimpleIoc.cs:line 768
         at GalaSoft.MvvmLight.Ioc.SimpleIoc.MakeInstance[TClass]() in c:\Users\Public\Downloads\CodePlex\MVVMLight\GalaSoft.MvvmLight\GalaSoft.MvvmLight.Extras (NET35)\Ioc\SimpleIoc.cs:line 708
    InnerException:
  </code></pre>
  
  <p>Here are pieces of my code related to this:</p>
  
  <p>ViewModelLocator.cs (Located in my Win8 project)</p>
  
  <pre><code>public class ViewModelLocator
  {
      /// &lt;summary&gt;
      /// Initializes a new instance of the ViewModelLocator class.
      /// &lt;/summary&gt;
      public ViewModelLocator()
      {
          ServiceLocator.SetLocatorProvider(() =&gt; SimpleIoc.Default);
  
          if (ViewModelBase.IsInDesignModeStatic)
          {
              // Create design time view services and models
              //SimpleIoc.Default.Register&lt;IDataService, DesignDataService&gt;();
          }
          else
          {
              // Create run time view services and models
              //SimpleIoc.Default.Register&lt;IDataService, DataService&gt;();
              SimpleIoc.Default.Register&lt;INavigationService, NavigationService&gt;();
              SimpleIoc.Default.Register&lt;IParseService, ParseService&gt;();
              SimpleIoc.Default.Register&lt;IServiceHandler, ServiceHandler&gt;();
          }
  
          SimpleIoc.Default.Register&lt;MainViewModel&gt;();
          SimpleIoc.Default.Register&lt;ActionViewModel&gt;();
      }
  
      public MainViewModel MainVM
      {
          get
          {
              return ServiceLocator.Current.GetInstance&lt;MainViewModel&gt;();
          }
      }
  
      public ActionViewModel ActionVM
      {
          get
          {
              return ServiceLocator.Current.GetInstance&lt;ActionViewModel&gt;();
          }
      }
  
      public static void Cleanup()
      {
          // TODO Clear the ViewModels
      }
  }
  </code></pre>
  
  <p>MainViewModel.cs Constructor</p>
  
  <pre><code>public class MainViewModel : ViewModelBase
  {
      #region Variables
  
      private readonly INavigationService _navigationService;
      private readonly IParseService _parseService;
  
      #endregion
  
      /// &lt;summary&gt;
      /// Initializes a new instance of the MainViewModel class.
      /// &lt;/summary&gt;
      public MainViewModel(INavigationService navigationService, IParseService parseService)
      {
          if (IsInDesignMode)
          {
              // Code runs in Blend --&gt; create design time data.
          }
          else
          {
              _navigationService = navigationService;
              _parseService = parseService;
              BuildCommonData();
          }
      }
  </code></pre>