Attempting to set up our app on a Win 2016 Server using the ISAPI protocols. It works in File Mode but we're getting this error when we try to switch to COM:
'Unable to retrieve a server instance from the server pool'
Not sure what our next step should be. Any suggestions would be appreciated.
--stein
did you check in Windows task manager if your exe is running?
Thanks. I will have them do that.
The problem was they were running under the .NET Managed Handler on this new server but were used to ISAPI on their old system. So they were trying to configure wc.ini instead of web.config.
--stein
As they should, as they should 😃
If I recall you have some specific issues that require you to use wc.dll
, right? If not you really should consider moving to the .NET module for improved stability and performance.
+++ Rick ---
No, I've got our app running on our development system under .NET and it's working fine. The only reason our customers continue to run the ISAPI module is simply inertia. It's working and they don't want to change. For the same reason, our tech support staff does not encourage them to make the switch.
In this case, the customer was moving to a new server so they did a fresh install and picked the .NET Handler from the setup wizard dropdown since it was the "preferred" choice, without realizing it was configured differently. They had copied wc.ini from their old server and thought it would pick up that configuration. Also, they set up a West Wind app pool but somehow didn't get it connected to their virtual directory (which caused the "unable to retrieve server instance" error. I sent them the text from my web.config to paste into their copy, and got them connected to the right app pool, so they are up and running. And now that I finally have a client running the .NET handler, I can use them as an example to encourage other customers to make the change.
--stein
Hi Rick
I read this thread with great interest as I am experiencing a similar issue (I think). I have a new very simple web connect .exe that I've created. I can run the .exe on my development machine in either file mode or COM mode and everything works great. However after uploading things to my Windows 2016 server machine the .exe still runs great in file mode but will not run in COM mode.
When I try to run in COM mode I get the following error:
An Error occurred
Unknown application error
Invalid Com Server ProgId: Cslicmgr.CslicmgrServer
For what it is worth: I checked both the cslicmgr.ini
and the web.config
file looking for any obvious path issues etc. (as I develop on a d: drive but deploying to a c: drive) but it all seems okay as I don't see any absolute path references in the file. I checked task manager to make sure the .exe was not already running. Could it be that some required support file or component is missing on my Windows Server 2016 box? If so, I've no clue what that might be or where to look.
Can you point me in the right direction on this?
Thanks
Alec
Are you running the .NET Handler or the ISAPI module and what version?
Couple of things. First off if you're on a recent version maybe grab the latest update file from:
https://west-wind.com/files/WebConnectionExperimental.zip
There was a recent bug that was fixed that in some scenarios would cause that error, but not consistently. Especially when loading explicitly from the admin page.
If that's not it - set your application pool to run under an Admin account to check and see if you're dealing with a permissions problem. Specifically if you didn't change the identity from Application Pool Identity
you won't be able to invoke a COM object due to missing registry permissions. Hence set to SYSTEM (or another Admin account) to ensure the permissions aren't the problem. If that works you can work on dialing back the permissions.
+++ Rick ---
Hi Rick,
Thanks for the info.
I'm running the .NET handler. My exe was built using wc 7.10 (but the same thing was happening with wc 7.09).
I hope I am interpreting your instructions correctly. The application pool for this specific server is set to WebConnection
. In the IIS Application Pools I've changed the Application Pool Identity for the WebConnection
application from Application Pool Identity
to LocalSystem
. I stopped and restarted IIS just to try to be sure that those settings were in place.
Unfortunately the issue of getting an error when I try to switch to COM mode still persists.
Alec
If you were running Application Pool Identity it definitely wouldn't have worked and that would account for the ProgId not found error.
Now, if you fixed that you should be seeing a different error now. What is it?
Also make sure you grab the updated webconnectionmodule.dll
file and try that. As I mentioned there may have been a bug in that which shows when loading servers off the Module Admin form.
+++ Rick ---
Hi Rick,
Well, I thought I did things correctly, however the error is still the same.
Here is how things look in IIS:
The application pool reference for the server is WebConnection
and in the application pools the identity reference for WebConnection
is LocalSystem
I tried replacing my old webconnectionmodule.dll
(Dated 10/23/2019) with the new one from the zip file (Dated 03/21/2020) in the \web\bin\ folder (is that the correct location?) and things go totally south when I try to load the server via COM or as a File.
Alec
If you're running a pre V7 version of webconnectionmodule.dll
you also need to put the Microsoft.WebSockets.dll
into your bin
folder - that accounts for the hard crash on startup with the new DLL.
Maybe ping me privately today and I can take a look at your server to see what's happening by doing a screen sharing session.
+++ Rick ---
So I took a look at your server and sure enough the COM object was not registered.
To test this I fired up a Powershell console and did:
# instantiate the server
$server = new-object -comObject 'yourProject.yourProjectServer'
# prints a simple HTML page HTTP Response (ie. it works!)
$server.ProcessHit("query_string=wwMaint~FastHit")
# release the server (optional)
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($server) | Out-Null
This failed for your server which means that the component is not registered.
Then to register in the deploy
folder:
yourProject.exe -regserver
Then try the above code again and it works. Going to the admin page, and reloading servers then works.
More info in the docs here:
Web Connection COM Server Configuration
FWIW if you use the automated configuration tools (ie. yourProject.exe CONFIG
), it will automatically register the COM server. But if you manually configure you obviously need to explicitly register the COM server.
+++ Rick ---
Hi Rick,
Thanks for taking a look. I'm fairly certain that I performed the automated configuration but obviously something went wrong. (Operator Error No Doubt).
Alec
It's always a good idea to double check. The CONFIG
setup will do what it can but the -regserver
switch works silently so if it doesn't work it doesn't actually tell you. You have to make sure that CONFIG
is run under and ADMIN
account otherwise the registration (and the IIS configuration either) won't work. So best to run from Powershell/Command and make sure you are running under Administrator.
I do believe that config checks for that but if it doesn't I need to add that to not even allow the IIS CONFIG to run without admin. pretty sure it does though.
Anyway - glad it's a simple thing like this even if it seems obvious 😃
+++ Rick ---