phpmanager icon indicating copy to clipboard operation
phpmanager copied to clipboard

upgrade routine broken

Open mbiebl opened this issue 7 years ago • 8 comments

Hi,

I've just upgraded from v2.1 to v2.2. After the upgrade, PHPManager was no longer shown in IIS Manager. I had to uninstall and then reinstall PHPManager. After that it was functional again and available in IIS Manager.

mbiebl avatar Dec 21 '18 00:12 mbiebl

In the windows event log I found the following error

IISMANAGER_ERROR_LOADING_PROVIDER_TYPE

IIS Manager could not load type 'Web.Management.PHP.PHPProvider, Web.Management.PHP, Version=2.1.0.0, Culture=neutral, PublicKeyToken=41b215c155952069' for module provider 'PHP' that is declared in %windir%\system32\inetsrv\config\administration.config. Verify that the type is correct, and that the assembly that contains the module provider is in the Global Assembly Cache (GAC).

Exception:System.IO.FileNotFoundException: Could not load file or assembly 'Web.Management.PHP, Version=2.1.0.0, Culture=neutral, PublicKeyToken=41b215c155952069' or one of its dependencies. The system cannot find the file specified.
File name: 'Web.Management.PHP, Version=2.1.0.0, Culture=neutral, PublicKeyToken=41b215c155952069'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.Web.Management.Server.AdministrationModuleProvider.GetModuleProvider(String userName, String connectionName)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Maybe that's related

mbiebl avatar Dec 21 '18 01:12 mbiebl

I have exact same issue upgrading from v2.1 to v2.3. I have to run v2.3 installer again to see PHP Manager icon in IIS

jinhr avatar Feb 26 '19 16:02 jinhr

I had a bit of a closer look: After a fresh installation of 2.4:

PS C:\> Select-String PHP C:\Windows\System32\inetsrv\config\administration.config

Windows\System32\inetsrv\config\administration.config:113:        <add name="PHP"
type="Web.Management.PHP.PHPProvider, Web.Management.PHP, Version=2.4.0.0, Culture=neutral,
PublicKeyToken=41b215c155952069" />
Windows\System32\inetsrv\config\administration.config:169:            <add name="PHP" />

All good. Now upgrade to 2.5:

PS C:\> Select-String PHP C:\Windows\System32\inetsrv\config\administration.config

Windows\System32\inetsrv\config\administration.config:113:        <add name="PHP"
type="Web.Management.PHP.PHPProvider, Web.Management.PHP, Version=2.4.0.0, Culture=neutral,
PublicKeyToken=41b215c155952069" />
Windows\System32\inetsrv\config\administration.config:169:            <add name="PHP" />

Not good, it still references the old version. I tried to add some logging to the custom action, but this turned out to be next to impossible. So I asked on the WiX users mailing list and they strongly recommened not to use InstallUtil but DTF.

http://lists.wixtoolset.org/pipermail/wix-users-wixtoolset.org/2021-March/009670.html

So, I gave DTF a go. It not only it simplified the code significantly and made it possible to add proper logging, it also fixed the upgrade issue. I'll clean up the branch and submit it as PR.

mbiebl avatar Mar 31 '21 14:03 mbiebl

@lextm See https://github.com/messageconcept/phpmanager/commit/0407b53f17ab65da4f07a54d6023f51fca303670 not quite done yet, but you get the picture where this is going. Nice reduction in code + it fixes this issue.

Will submit as PR once ready.

mbiebl avatar Mar 31 '21 16:03 mbiebl

@mbiebl DTF was in fact used in PHP Manager installer when I revived it. But it was replaced because DTF does not work well when .NET Framework 2.x was in the picture. See #9 for more background.

Luckily all those old platforms are now end of life (IIS 7 and 7.5), so I think it is time to move back to DTF. A pull request should be as easy as rolling back the relevant commits I made earlier, but you can definitely start from scratch.

lextm avatar Mar 31 '21 20:03 lextm

Hm, I tested the Installer with my changes on a Windows Server 2008R2 with IIS7 (and .NET 4.8 installed). The resulting installation worked fine.

mbiebl avatar Mar 31 '21 20:03 mbiebl

A pull request should be as easy as rolling back the relevant commits I made earlier, but you can definitely start from scratch.

Which commits are those?

mbiebl avatar Mar 31 '21 20:03 mbiebl

A pull request should be as easy as rolling back the relevant commits I made earlier, but you can definitely start from scratch.

Fwiw, I'm not attached to having my changes merged as long as the upgrade issue is fixed. So if you prefer to roll back your own commits, that works for me too.

mbiebl avatar Apr 07 '21 00:04 mbiebl

Instead of merging this pull request, I reverted the code back to its very beginning in #57 and achieved the same.

Now 2.11 has been downloaded about 1.6k and no more report on this issue occurred, so I think it is safe to close it now.

Thanks for your efforts.

lextm avatar Jan 15 '23 02:01 lextm