powershellinstallutilpssnapin

No installers found when running install util on custom pssnapin


I created a very simple PSSnapin but when I go to run IntallUtil against the assembly I get the following:

No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\Tools\PowerShellCommands\SetServerDataSource\bin\Debug\SetServerDataSource.dll assembly. Remove InstallState file because there are no installers.

However, I definitely have an installer (inherited from CustomPSSnapIn) with [RunInstaller(true)]:


[RunInstaller(true)]
public class SetServerDataSourcePSSnapIn : CustomPSSnapIn
{
   ///
}

Any ideas?


Solution

  • Be carefull to install it with the good InstallUtil.exe. It exists a 64 bits ans a 32 bits.

    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe
    

    Versus

    C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
    

    You may adapt this to the framework in usage in your company. It depends from where you referenced System.Management.Automation . On a 64bit computer if you do it from :

    C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0
    

    Its a 64Bis assembly.