none
Create Object for System.EnterpriseServices.Internal.Publish requires .net framework 3.5 to be installed RRS feed

  • Question

  • In VB Script Creating object for System.EnterpriseServices.Internal.Publish requires .net framework 3.5 to be installed but the same class in available in higher versions of .net framework. No where it is mentioned this feature is deprecated. Basically we don't want to install .net framework 3.5 just only for this purpose. 

    'Create object for installing to GAC
    Set myGacUtilObj = CreateObject("System.EnterpriseServices.Internal.Publish")
    myGacUtilObj.GacInstall(assemblyName)
    myGacUtilObj.GacRemove(assemblyName)

    if .net framework 3.5 is installed/enabled the above code works fine otherwise it throws a pop up while creating object saying this requires .net framework 3.5 to be installed(if pop up is not been thrown please try debugging script so that pop up will be displayed. I am wondering why higher versions of .net framework are not supporting this. I couldn't find any alternative way to do it.

    Thanks and Regards,
    Chenna 
    • Edited by Chenna Krishna Tuesday, October 10, 2017 5:04 AM
    • Moved by Bill_Stewart Wednesday, November 29, 2017 6:13 PM Not a scripting question
    Tuesday, October 10, 2017 5:02 AM

All replies

  • Because it requires the installation of 3.5.  That is how Net works with this class.

    Support for VBScript and classic COM is being dropped.  To use this run it from PowerShell.

     add-type -AssemblyName System.EnterpriseServices
     [System.EnterpriseServices.Internal.Publish]
     $pub = [System.EnterpriseServices.Internal.Publish]::new()
     $pub.GacInstall($name)


    \_(ツ)_/

    Tuesday, October 10, 2017 7:01 AM