0
votes

I can use this program on my own computer, but I can not use on the server.

Server use supreme authority Administrator to open the program.

Server WCF HTTP Activation Feature with .NET4.5 is opening.

Server endpoint address use "http://localhost" like following

endpoint address="http://localhost" binding="basicHttpBinding" bindingConfiguration="NewBinding0" name="ProductService" contract="ProductService.IWCFProductService"

Wrong Message:

The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.

Stack trace at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)

at System.ServiceModel.ServiceHostBase.System.IDisposable.Dispose()

at FileUtilityHelperService.Program.Main(String[] args)

1
You're not seeing the root cause exception, because you most likely (need code to be sure) run in this issue. Workaround as described in the link and post the actual exception details.Christian.K

1 Answers

0
votes

This simply means that there has been an unexpected exception somewhere in your code. The error message "...because it is in the Faulted state" means that communication between the server and the client is unusable.
What you need is better error handeling.

  1. Use try/catch around your code that can potentially generate an exception
  2. Always order exeptions from the most specific to the least specific

You would probably like to log your errors to a file or database, log4net is great for this (and comes as a nuget package)