TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vineet sharma
NA
22
21.8k
error in wcf while opening the servicehost
Mar 26 2014 2:53 AM
here is my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;
namespace EmployeeServiceHost
{
class Program
{
static void Main()
{
using (ServiceHost host = new ServiceHost(typeof(EmployeeServices.EmployeeService)))
{
try
{
host.Open();
Console.WriteLine("SERVER STARTED @: " + DateTime.Now.ToString());
Console.ReadLine();
}
catch(Exception er)
{
Console.WriteLine(er.ToString());
}
finally
{
host.Close();
}
}
}
}
}
and my app.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<services>
<service name="EmployeeServices.EmployeeService" behaviorConfiguration="mexBehaviour">
<endpoint address="EmployeeServices" binding="basicHttpBinding" contract="EmployeeServices.IEmployeeService"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehaviour">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
error i m getting is
An unhandled exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
Additional information: The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.
thanks in advance
Reply
Answers (
1
)
How Many Request a WCF Service Can Process
is it secure to send windows password via netNamedPipe