Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:32:37+00:00 2026-05-28T14:32:37+00:00

I have added WCF Service Application project type to my VS solution(4.0). Now, the

  • 0

I have added “WCF Service Application” project type to my VS solution(4.0). Now, the default namespace that appears is “Service” and if I run the application (Pointing WCF service application as the startup project) it works fine.

Now I have changed the namespace to XXX.YYY.Service.PartnerPortal as under

namespace XXX.YYY.Service.PartnerPortal
{        
    public class Service1 : IService1
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }        
    }
}

As well as the IService1 interface also

namespace XXX.YYY.Service.PartnerPortal
{    
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        string GetData(int value);        
    }
}

Also I have changed the default namespace in the project properties

The app.config file is as under

<?xml version="1.0"?>
<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
        </compilation>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <system.serviceModel>  

    <behaviors>
            <serviceBehaviors>
                <behavior>
                    <!-- 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="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
        </modules>
    </system.webServer>
</configuration>

And while trying to run, the error messageI am receiving is

Error: Cannot obtain Metadata from http://localhost:65192/Service1.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:65192/Service1.svc Metadata contains a reference that cannot be resolved: ‘http://localhost:65192/Service1.svc&#8217;. The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error URI: http://localhost:65192/Service1.svc There was an error downloading ‘http://localhost:65192/Service1.svc&#8217;. The request failed with the error message:– The type ‘Service.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. body {font-family:”Verdana”;font-weight:normal;font-size: .7em;color:black;} p {font-family:”Verdana”;font-weight:normal;color:black;margin-top: -5px} b {font-family:”Verdana”;font-weight:bold;color:black;margin-top: -5px} H1 { font-family:”Verdana”;font-weight:normal;font-size:18pt;color:red } H2 { font-family:”Verdana”;font-weight:normal;font-size:14pt;color:maroon } pre {font-family:”Lucida Console”;font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

Server Error in ‘/’ Application.

The type ‘Service.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 ‘Service.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 'Service.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) +51530   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651[ServiceActivationException: The service '/Service1.svc' cannot be activated due to an exception during compilation.  The exception message is: The type 'Service.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) +688590   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +359   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information:ÿMicrosoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 –.

What wrong I am doing and how to fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:32:38+00:00Added an answer on May 28, 2026 at 2:32 pm

    Open your svc file, and correct the namespace in the Service attribute value

    <%@ ServiceHost Language="C#" Debug="true" Service="XXX.YYY.Service.PartnerPortal.Service1" .....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF Service application project , a class library project (acts as
I have a web application, in which i have added wcf service item using
I currently have a wcf service library project that includes my service contract &
I have created a new wcf4 web application and added a new wcf service.
I have a WCF web service called Palladium that is created as a project
Hi, I have a WCF service in IIS7 that communicates with a winform application
Is it possible to log WCF service exceptions? I have added in the app.config.
I have a WCF service running, I added a reference to the service by
I have a SOA application. 1. data layer: Entity Framework 2. Service layer: WCF
I have my WCF Service hosted in Windows Service. The client application is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.