/* by josh */

2013年9月10日 星期二

[Visual Studio] 加入WCF服務參考時產生錯誤"無法為服務參考xxx產生程式碼"或加入參考時"建置系統已經參考這個元件"


When you add Service Reference into Silverlight project, some time you get “failed to generate code for the service reference…” error.  Which means Visual Studio is failed to generate client code, and if see “ServiceReferences.ClientConfig” file it is empty. This is the common error most of the people get.

Step 1. In "Add Service Reference", Get in to "Advance"
 
 
 
Step 2. uncheck the “Reuse types in referenced assemblies” check box and click on Ok button.
 
Once you click on Ok button in Service Reference dialog box, the client code will be generated and you will not get any error. Now if you open “ServiceReferences.ClientConfig” file you can see the generated code.