If you want to share same port between multiple instances on the same server you have to do these steps:
7046
is default)sc config MicrosoftDynamicsNavServer$NavInstanceName depend= NetTcpPortSharing/HTTP
wmic useraccount where (name='service-account-login' and domain='%userdomain%') get name,sid
<system.serviceModel.activation> <net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false"> <allowAccounts> <add securityIdentifier="--SID of your service account--"/> </allowAccounts> </net.tcp> </system.serviceModel.activation>
SMSvcHost.exe
executable to reload with new .config configuration (or to be sure whole server).The service MicrosoftDynamicsNavServer$ApsTest failed to start. This could be caused by a configuration error. Detailed error information:System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:7046. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
This error occurs when you forgot to add dependency on NetTcpPortSharing
service on your NAV instances services.
The service MicrosoftDynamicsNavServer$ApsTest failed to start. This could be caused by a configuration error. Detailed error information:System.ServiceModel.CommunicationException: The service endpoint failed to listen on the URI 'net.tcp://server:7046/ApsTest/Service' because access was denied. Verify that the current user is granted access in the appropriate allowAccounts section of SMSvcHost.exe.config. ---> System.ComponentModel.Win32Exception: Access is denied
This error occurs when you forgot to add SID of your system account to the SMSvcHost.exe.config
file or if you update wrong config file (there are multiple files with this name on the server).