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 6831465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:44:26+00:00 2026-05-26T22:44:26+00:00

I’ve had not a lot of luck creating a WCF service with Visual Studio.

  • 0

I’ve had not a lot of luck creating a WCF service with Visual Studio. It’s in IIS, and it I click ‘browse’ on the .svc file itself, it tells me I have created a service. So I assume it’s all okay to a point.

Throughout my time I came across a recommendation to use a program called svcutil.exe. I used it on my service and got the following error. I don’t know what it means, so hopefully someone can shed some light on the situation.

Here’s the result:

 Microsoft (R) Service Model Metadata Tool

[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]

Copyright (c) Microsoft Corporation.  All rights reserved.



Attempting to download metadata from 'http://localhost/EvalServiceSite/Eval.svc'

using WS-Metadata Exchange or DISCO.

Error: Cannot import wsdl:portType

Detail: An exception was thrown while running a WSDL import extension: System.Se

rviceModel.Description.DataContractSerializerMessageContractImporter

Error: Schema with target namespace 'http://tempuri.org/' could not be found.

XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'

]/wsdl:portType[@name='IEvalService']





Error: Cannot import wsdl:binding

Detail: There was an error importing a wsdl:portType that the wsdl:binding is de

pendent on.

XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/

']/wsdl:portType[@name='IEvalService']

XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'

]/wsdl:binding[@name='BasicHttpBinding_IEvalService']





Error: Cannot import wsdl:port

Detail: There was an error importing a wsdl:binding that the wsdl:port is depend

ent on.

XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/'

]/wsdl:binding[@name='BasicHttpBinding_IEvalService']

XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'

]/wsdl:service[@name='EvalService']/wsdl:port[@name='BasicHttpBinding_IEvalServi

ce']





Generating files...

Warning: No code was generated.

If you were trying to generate a client, this could be because the metadata docu

ments did not contain any valid contracts or services

or because all contracts/services were discovered to exist in /reference assembl

ies. Verify that you passed all the metadata documents to the tool.



Warning: If you would like to generate data contracts from schemas make sure to

use the /dataContractOnly option.
  • 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-26T22:44:27+00:00Added an answer on May 26, 2026 at 10:44 pm

    I think this previous Stack Overflow question may help with your current question but not necessarily your problem.

    Error: Cannot import wsdl:port with svcutil

    You’ve created your WCF service and you’ve browsed to it in IIS so you’re happy that it is working. The purpose of SVCUtil.exe is to generate classes that you can use in an application to interact with the service with compile time information on the contract members and methods.

    it performs the exact same function as adding a service reference in visual studio to consume the service.

    If your having trouble, i’d suggest just creating a simple console project in visual studio, adding a service reference and giving it the url of the service you’ve hosted in IIS. Then click “show all files” in the visual studio solution explorer and look at the reference.cs file it gives you. This will show you what information has been consumed from your service.

    Edit

    Hi Again,

    After going through all the comments below I’m starting to see more about your problem. I think you misunderstand what it is your doing when in fact you’ve already achieved what you want to achieve.

    The original project, the one you had with the WCF test client that worked did what you needed. It is a fully fledged WCF Service. All you needed to do was right click the solution in visual studio and publish it. If you then make sure that you make an IIS virtual directory point at your solution, through the publish wizard. Then when you run your project and then browse to that url, that will give you a service to consume for testing purposes.

    What you are doing at the moment, creating a WCF project, adding that DLL to a website project is fundamentally wrong: The example you followed, presumably this one :
    http://msdn.microsoft.com/en-us/library/ms733766.aspx
    is about creating a WCF service in a web site project from scratch. Not about adding a pre-existing WCF project and hosting it.

    Your essentially trying to do one thing in two different ways together.

    Your current course of action is to either remove the DLL in your web project and then create the service there. Or host your current WCF service in IIS ( the project you downloaded from me or your original one)

    At this point you have a hosted service. Then usually you have an application to interact wtih it. This you found using svcutil and can be done in one of two ways:

    You create the console application and do “Add Service Reference” to the URL you have hosted in IIS.

    Or you use SVC Util.exe point it at the url which generates a class file you include in your console / application.

    I hope that clears things up about WCF and what stages to use various tools?

    Edit 2

    Just in case you don’t get to the Chat:

    I still think theres something wrong with your original project. I’m not sure what you mean by the one with the DLL either? if that means your website project with the dll of the WCF project, then no not that one.

    I’ve taken the project I sent you earlier. I’ve hosed that in IIS so that when i browse to localhost/EvalService on my machine i get the standard

    “EvalService Service

    You have created a service.

    To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:”

    Once I had that set up i created a console application, “added service reference” in visual studio and it consumed teh service no problem.

    Try doing the above with the project I sent you and see how far you get.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I want use html5's new tag to play a wav file (currently only supported
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I know there's a lot of other questions out there that deal with this

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.