Issue with reinstall on Windows Server 2022

Steps to reproduce:

  1. Install clean Windows Server 2022 Standard with Desktop Experience
  2. Install NCS
  3. Start NCS Server to create initial folders and settings then close
  4. Copy over configuration files from previous server
  5. Set NCS service to Automatic and attempt to start


  • The following message is displayed in the Event Log:

Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object. at Moonware.Security.MoonwarePrincipal..ctor(IIdentity identity, String authToken, Boolean forceServiceAccount)

  • This is a known issue with .NET Framework installation

Attempts to resolve:

  1. Remove .NET Framework 4.8 and reinstall
    1.1. Server Manager | Manage | Remove Roles and Features
    1.2. Select .NET Framework 4.8 Features | .NET Framework 4.8
    1.3. The following warning is displayed:

    1.3. Aborted removal of .NET Framework 4.8

  2. Install .NET Framework 3.5
    2.1. Server Manager | Manage | Add Roles and Features
    2.2. Select .NET Framework 3.5 Features | .NET Framework 3,5
    2.3. After install, reboot server and attempt to start NCS
    2.4. Same error message appears

  3. Repair NCS install
    3.1. Click on NCS download, run as administrator
    3.2. Select Repair, allow to complete
    3.3. Same error message appears

I will continue to review other potential solutions. Please can someone look into this.

First, running NCS on server 2022 is not officially approved yet.
For that error this sometimes help:
-stop NCS.
-go to C:\Users%username%\AppData\Local\Moonware and delete all.
-go to C:\Users%username%\AppData\Roaming\Moonware and delete all.
-start NCS again.
If still that error, do a clean installation.


  1. Stop NCS
    1.1. NCS was not running anyway
  2. Delete local details
    2.1. Location was C:\Users\filesvc\AppData\Local\Moonware_Studios
    2.2. Confirm deleted
  3. Delete roaming details
    3.1. Location was C:\Users\filesvc\AppData\Roaming\Moonware
    3.2. Confirm deleted
  4. Start NCS
    4.1. Same error appeared

Doing a full uninstall and clean install.

Result: Same error message after uninstall and reinstall.

What are the next steps?

Install Visual C++ from Netcam Studio - Network Camera Surveillance Software


  1. Uninstalled NCS
  2. Installed Visual C++
  3. Installed NCS
  4. Started NCS

Same error message appeared

I also attempted to restart NCS on my previous server and got the same message. Will be attempting to reset my install on that device to get it working. It is running Windows Server 2016 Essentials.

This is legitimately odd, I can’t get the service to start on the old server. Here are the steps:

  1. Stop NCS
  2. Copy configuration files to network location to be used on new server

That’s all I did - and now when I access the server and start the service, I get the error message:
Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object. at Moonware.Common.RuleManager.NotifyEvent(BaseEvent evnt) at Moonware.Core.MoonwareCore..ctor(NetConfig ) at Moonware.Server.WCF.MoonwareServerWCF..ctor(NetConfig ) at ..( ) at ..(String[] ) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

Nothing else has changes on this server at all - no changes to config files, no changes to system set up, no updates to system.

I have fixed this issue!

I am confirming that my previous server was running v1.9.5.0 and my new server is running v1.9.5.0. both 64-bit.

I reviewed all forums posts related to this and tried the following:

  1. Uninstall Netcam Studio 64-bit
  2. Remove all data from:
    2.1. C:\ProgramData\Moonware\
    2.2. C:\Program Files\Netcam Studio - 64-bit
    2.3. C:\Users\[user]\AppData\Local\Moonware_Studios\
    2.4. C:\Users\[user]\AppData\Roaming\Moonware\
  3. Confirm installation of:
    3.1. Feature : .NET Framework 4.8
    3.2. Feature : Media Foundation
    3.3. Program: Microsoft Visual C++ 2015-2019 Redistributable (x64)
  4. Reinstall Netcam Studio 64-bit
  5. Start the NCS service successfully
  6. Access Netcam Studio Client to confirm connectivity
  7. Stop the NCS service
  8. Copy files Netcam.Security.xml, Rules.xml, & Server.config to C:\ProgramData\Moonware\Netcam Studio\Server\
  9. Start the NCS service
  10. Error Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object occured
  11. Removed and Rules.xml
  12. Start NCS service
  13. Service started correctly
  14. When accessing Netcam Studio Client, had to use u:admin p:1234 rather than my previous settings
  15. Confirmed all camera sources were correct
  16. Checked settings and confirmed library target and other values were correct
  17. Used Access Control to set admin password and add other users
  18. Exited Netcam Studio Client
  19. Restarted Netcam Studio Client and confirmed settings were saved
  20. Closed Netcam Studio Client
  21. Stopped NCS service (only way to make the next bit work)
  22. Opened Netcam Studio X
  23. Accessed the license key area
  24. Entered license key and confirmed online activation
  25. Closed Netcam Studio X
  26. Started NCS service
  27. Confirmed with both web view and Netcam Studio Client that all sources were visible, logging, and licensed

Problem fixed. The root cause seems to be an issue when copying over the security and/or rules configuration XML files. This may warrant testing and adjusting the directions if necessary.

1 Like