If you upgrade from K2 4.7 and MSMQ is removed from the server, you will see an MSMQ-related error in the K2 server log ouput with the error text System.InvalidOperationException: Message Queuing has not been installed on this computer. The error does not affect operation of the K2 service or applications, and this article explains why the error occurs, and how to prevent it.

If you perform a clean installation of K2 Five 5.0 or later and MSMQ is not installed on the server, you may also see an exception with the message System.InvalidOperationException: Message Queuing has not been installed on this computer in the installer log. The exception does not prevent the install from successfully finishing, and is only written to the K2 installation log. You can safely ignore this error message when installing K2 Five, and if you see the error in the K2 runtime logfiles, you can apply the resolution in this article to remove the error.

Cause

K2 implemented a new message queuing mechanism in K2 Five that replaces MSMQ. The new mechanism includes a clean-up method that checks MSMQ for messages and processes them to empty the queue before switching to the new method. This clean-up relies on settings in the K2HostServer.exe.config file.
When the new mechanism clears the legacy messages from the queue, and MSMQ is no longer in the system but the settings remain in the K2HostServer.exe.config file, the new message queuing mechanism tries to perform the clean-up check. This causes the MSMQ error in the K2 server log.

Solution

The K2 Five server processes legacy messages in the queue when it starts up after you upgrade from K2 4.7. You can check that the message queue is empty by opening Computer Management and browsing to the Queue messages item as shown below:
Image

Once the new mechanism clears the message queue and the MSMQ queue is empty and deleted, you can delete the MSMQ settings in the K2HostServer.exe.config file as described below:

  1. Stop the K2 service.
  2. Make a backup of the K2HostServer.exe.config file. The default path to the file after an upgrade is [Program Files]\K2\Host Server\Bin\K2HostServer.exe.config.
  3. Open the K2HostServer.exe.config file in a text editor.
  4. Locate and delete the following attributes and their values:
    • msmqpath
    • msmqemptyqueueassembly
    • memqemptyqueuetype
    • msmqemptymethodsignature
      The screenshot below is an example of the values to be deleted - everything surrounded by a red box can be deleted. Your values may be different.
    Image
  5. Start the K2 service.
  6. If you are running an environment with multiple physical K2 servers, repeat steps 1-5 on each physical server in your K2 environment.