title: Microsoft.Practices.ServiceLocation.ActivationException
body: <p>I'm trying to create an instance using ServiceLocator</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Gets the MediaPlayer property.
  /// &lt;/summary&gt;
  [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "This non-static member is needed for data binding purposes.")]
  public MediaPlayerViewModel MediaPlayer
  {
      get
      {
          try
          {
              return ServiceLocator.Current.GetInstance&lt;MediaPlayerViewModel&gt;();
          }
          catch (Exception e)
          {
              System.Console.WriteLine(e.ToString());
              return null;
          }
      }
  }
  </code></pre>
  
  <p>but i get the following excpetion:</p>
  
  <blockquote>
    <p>Microsoft.Practices.ServiceLocation.ActivationException was unhandled
    by user code   HResult=-2146233088   Message=Activation error occurred
    while trying to get instance of type MediaPlayerViewModel, key ""<br>
    Source=Microsoft.Practices.ServiceLocation   StackTrace:
           at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type
    serviceType, String key) in
    c:\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line
    53
           at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstanceTService
    in
    c:\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line
    90
           at Verint.PI2.MediaPlayer.UI.ViewModel.ViewModelLocator.get_MediaPlayer()
    in c:\Users\ekreiczer\Documents\Visual Studio
    2012\Projects\player\Verint.PI2.MediaPlayer.UI\ViewModel\ViewModelLocator.cs:line
    73   InnerException:
    Microsoft.Practices.Unity.ResolutionFailedException
           HResult=-2146233088
           Message=Resolution of the dependency failed, type = "Verint.PI2.MediaPlayer.UI.ViewModel.MediaPlayerViewModel", name =
    "(none)". Exception occurred while: while resolving. Exception is:
    InvalidOperationException - The current type,
    Verint.PI2.MediaPlayer.UI.Services.IDialogService, is an interface and
    cannot be constructed. Are you missing a type mapping?</p>
  </blockquote>
  
  <p>I don't know how to type map, can anyone help?</p>