title: Embedding Powershell v2.0 in .NET app on Windows 8 RTM
body: <p>Im getting the following error when trying to run hosted powershell scripts before upgrading from Windows 7 I never got this error.</p>
  
  <blockquote>
    <p>The following error occurred while loading the extended type data
    file:  Microsoft.PowerShell.Core,
    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2977) : Error
    in type "System.Security.AccessControl.ObjectSecurity": Exception: The
    getter method should be public, non void, static, and have one
    parameter of type PSObject. Microsoft.PowerShell.Core,
    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2984) : Error
    in type "System.Security.AccessControl.ObjectSecurity": Exception: The
    getter method should be public, non void, static, and have one
    parameter of type PSObject. Microsoft.PowerShell.Core,
    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2991) : Error
    in type "System.Security.AccessControl.ObjectSecurity": Exception: The
    getter method should be public, non void, static, and have one
    parameter of type PSObject. Microsoft.PowerShell.Core,
    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2998) : Error
    in type "System.Security.AccessControl.ObjectSecurity": Exception: The
    getter method should be public, non void, static, and have one
    parameter of type PSObject. Microsoft.PowerShell.Core,
    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3005) : Error
    in type "System.Security.AccessControl.ObjectSecurity": Exception: The
    getter method should be public, non void, static, and have one
    parameter of type PSObject.</p>
  </blockquote>
  
  <p>I have applied the following in App.config:</p>
  
  <pre><code>&lt;dependentAssembly&gt;
    &lt;assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" /&gt;
    &lt;publisherPolicy apply="no" /&gt;
  &lt;/dependentAssembly&gt;
  </code></pre>
  
  <p>What could the issue be?</p>