none
ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found RRS feed

  • Question

  • Hi MSDN,

    I'm really suck... and cannot found a solution to the Service project run error. The discovery button did not download a wsdl file type. And I did not try running svcutil.

    Any suggestion?

    // Web.config file:

    <?xml version="1.0"?>

    <configuration>

        <system.web>

            <compilation debug="true" targetFramework="4.0"/>

            <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

        </system.web>

        <system.serviceModel>

            <serviceHostingEnvironment>

                <serviceActivations>

                    <add relativeAddress="Service1.svc" service="TeleCom.Service1"/>

                </serviceActivations>

            </serviceHostingEnvironment>

            <services>

                <service behaviorConfiguration="Service1Behavior" name="TeleCom.Service1">

                    <host>

                        <baseAddresses>

                            <add baseAddress="http://localhost:8000/TeleCom/"/>

                        </baseAddresses>

                    </host>

                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

                    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBasicUser" contract="CommonTools.IBasicUser">

                        <!--

                              Upon deployment, the following identity element should be removed or replaced to reflect the

                              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity

                              automatically.

                          -->

                        <identity>

                            <dns value="localhost"/>

                        </identity>

                    </endpoint>

                </service>

            </services>

            <behaviors>

                <serviceBehaviors>

                    <behavior name="Service1Behavior">

                        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->

                        <serviceMetadata httpGetEnabled="true"/>

                        <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->

                        <serviceDebug includeExceptionDetailInFaults="true"/>

                    </behavior>

                </serviceBehaviors>

            </behaviors>

            <bindings>

                <basicHttpBinding>

                     <binding name="BasicHttpBinding_IBasicUser" closeTimeout="00:10:00"

                        openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"

                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

                        maxBufferSize="2147483647" maxBufferPoolSize="2147483647"

                        maxReceivedMessageSize="2147483647" messageEncoding="Mtom"

                        textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

                        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"

                            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

                        <security mode="None">

                            <transport clientCredentialType="None" proxyCredentialType="None" realm="">

                                <extendedProtectionPolicy policyEnforcement="Never" />

                            </transport>

                            <message clientCredentialType="UserName" algorithmSuite="Default" />

                        </security>

                    </binding>

                </basicHttpBinding>

                <wsHttpBinding>

                    <binding name="WSHttpBinding_IBasicUser" closeTimeout="00:10:00"

                        openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"

                        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"

                        maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"

                        messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"

                        allowCookies="false">

                        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"

                            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

                        <reliableSession ordered="true" inactivityTimeout="00:10:00"

                            enabled="false" />

                        <security mode="Message">

                            <transport clientCredentialType="Windows" proxyCredentialType="None"

                                realm="">

                                <extendedProtectionPolicy policyEnforcement="Never" />

                            </transport>

                            <message clientCredentialType="Windows" negotiateServiceCredential="true"

                                algorithmSuite="Default" establishSecurityContext="false" />

                        </security>

                    </binding>

                </wsHttpBinding>

            </bindings>

            <!--<client>

                <endpoint address="http://localhost:8000/TeleCom/Service1.svc" binding="basicHttpBinding"

                    bindingConfiguration="BasicHttpBinding_IBasicUser" contract="CommonTools.IBasicUser"

                    name="BasicHttpBinding_IBasicUser" />

            </client>-->

        </system.serviceModel>

    </configuration>

     

    // The Interface file is:

    using System.ServiceModel;

    using System;

    namespace CommonTools

    {

    [ServiceContract(SessionMode = SessionMode.Allowed, CallbackContract = typeof(IBasicUserCallBack))]

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]

    public interface IBasicUser

    {

    [OperationContract]

    Guid Subscrible(Client client);

    [OperationContract(IsOneWay = true)]

    void Unsubscrible(Guid clientId);

    [OperationContract(IsOneWay = true)]

    void KeepConnection();

    [OperationContract]

    byte[] DownLoadScreen();

    [OperationContract]

    byte[] DownLoadCursor();

    [OperationContract]

    void PushScreen(byte[] data);

    [OperationContract]

    oid PushCursor(byte[] data);

    [OperationContract]

    byte[] GetMemberData(Guid clientId);

    [OperationContract]

    bool SetAuthenicationKey(String key);

    [OperationContract]

    void SetSupperKey(Guid senderId, bool Enable);

    [OperationContract(IsOneWay = true)]

    void RemoveClient(Guid clientId);

    }

    [ServiceContract(SessionMode = SessionMode.Allowed)]

    public interface IBasicUserCallBack

    {

    [OperationContract(IsOneWay = true)]

    void BroadcastMessage(string message);

    [OperationContract(IsOneWay = true)]

    void SetWebCamOption(Guid id, bool enable);

    [OperationContract(IsOneWay = true)]

    void SetSendOption(Guid clientId, bool enable);

    [OperationContract(IsOneWay = true)]

    void PrivatePopupMessage(Guid clientId, String senderName, String message);

    }

    [ServiceContract(CallbackContract = typeof(IBasicVideoCallBack))]

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]

    public interface IBasicVideo

    {

    [OperationContract]

    byte[] Transfer(byte[] data, Guid recipeant);

    [OperationContract]

    Byte[] TransferPackMedia(byte[] data, Guid recipeantId, Guid senderId);

    [OperationContract]

    Byte[] ReceiveText(Guid recipeantId, Guid senderId);

    [OperationContract]

    Byte[] PushNewClient(Guid recipeantId, Client client);

    }

    [ServiceContract]

    public interface IBasicVideoCallBack

    {

    [OperationContract(IsOneWay = true)]

    void EnableClientConferring(Guid clientId, bool Enable);

    [OperationContract(IsOneWay = true)]

    void SendText(Guid clientId, string message);

    }

    }

    // The Service will not update due to the following Error:

    Server Error in '/TeleCom' Application.

     

    The type 'TeleCom.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: The type 'TeleCom.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

    Source Error:

     

    An unhandled exception was generated during   the execution of the current web request. Information regarding the origin   and location of the exception can be identified using the exception stack   trace below.

    Stack Trace:

    [InvalidOperationException: The type 'TeleCom.Service1',   provided as the Service attribute value in the ServiceHost directive, or   provided in the configuration element   system.serviceModel/serviceHostingEnvironment/serviceActivations could not be   found.]

         System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String   constructorString, Uri[] baseAddresses) +59638

         System.ServiceModel.HostingManager.CreateService(String   normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1434

         System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo   serviceActivationInfo, EventTraceActivity eventTraceActivity) +52

         System.ServiceModel.HostingManager.EnsureServiceAvailable(String   normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598

    [ServiceActivationException: The service '/TeleCom/Service1.svc'   cannot be activated due to an exception during compilation.  The exception message is: The type   'TeleCom.Service1', provided as the Service attribute value in the   ServiceHost directive, or provided in the configuration element   system.serviceModel/serviceHostingEnvironment/serviceActivations could not be   found..]

         System.Runtime.AsyncResult.End(IAsyncResult result) +495736

         System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult   result) +178

         System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication   context, String routeServiceVirtualPath, Boolean flowContext, Boolean   ensureWFService) +229

         System.ServiceModel.Activation.HttpModule.ProcessRequest(Object   sender, EventArgs e) +333

         System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   +136

         System.Web.HttpApplication.ExecuteStep(IExecutionStep step,   Boolean& completedSynchronously) +69

     

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044

    Thanks,

    King


    King Coffee


    • Edited by King Coffee Wednesday, June 26, 2013 3:47 AM
    Tuesday, June 25, 2013 1:05 PM

Answers