Sometimes on a WCF project you will get the error:

Failed to generate code for the service reference 'YourReferenceName'.  Cannot import wsdl:portType  Detail: An exception was thrown while running a WSDL import extension:

This is usually caused by a contract mismatch. For us it is when the assembly that contains our data contracts on the server and client are different.

First thing to check is the output window but if nothing is there I have found using svcutil.exe from a visual studio command prompt to generate the proxy on the command line gives me the info I need to diagnose the problem.

svcutil.exe /language:cs /out:TempProxy.cs /config:app.config /reference:DataContracts.dll http://address/to/service.svc

Flag Break Down:

/language What language to generate in (cs, vb, or, c++)
/out The file we want our proxy code in (this is a new file I am using)
/config Generate a new config file. 
/references The file that contains our datacontracts/service contracts that we want to re-use in our application.

There are a ton more flags but this is usually sufficient to get the message of why it is having issues generating the proxy. The other flags can be found by searching for svcutil.exe on MSDN.