Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I cannot add service reference(WCF library) to MVC4 in VS2012

My problem is very simple, but unfortunately I cannot figure out what's wrong. I've created a new MVC4 Internet Application project with Razor syntax, then I added another WCF Library project to this solution. I did not make any change on these codes. However, as I added the WCF project as a service reference in the MVC 4 app, I'm getting 1 Error message and 3 Warning messages:

  1. Error 4 Custom tool error: Failed to generate code for the service reference 'ServiceReference1'. Please check other error and warning messages for details. c:\users\vendre\documents\visual studio 2012\Projects\MvcApplication3\MvcApplication3\Service References\ServiceReference1\Reference.svcmap 1 1 MvcApplication3
  2. Warning 1 Custom tool warning: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Could not load file or assembly 'DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. The system cannot find the file specified.
  3. Warning 2 Custom tool warning: Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IService1']
  4. Warning 3 Custom tool warning: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='BasicHttpBinding_IService1']

I read some article but did not resolved my problem. If somebody know the answer for my problem, please tell me.

THX.

like image 544
Vajda Endre Avatar asked May 05 '13 06:05

Vajda Endre


2 Answers

If you're experiencing this problem in 2021 with VS2019. Add a folder to the project called "Connected Services"

like image 84
Evan Parsons Avatar answered Oct 23 '22 03:10

Evan Parsons


sometimes you need to create a folder "Service References" in project path. If you dont have this folder it should gives this path error.

like image 44
MİRAÇ Avatar answered Oct 23 '22 03:10

MİRAÇ