NetCFSvcUtil.exe and Windows 7

NetCFSvcUtil.exe is the analogous of Svcutil.exe but for devices. You can use it to generate a WCF client from a WCF service. You can then consume the generated client code in a Windows Mobile application . Unfortunately, the current version of NetCFSvcUtil.exe (3.5.7338.0) that is available from Power Toys for .NET Compact Framework 3.5 might not work on Windows 7. You might see the following error when running NetCFSvcUtil on Windows 7.

C:UsershabibhDesktopServiceAgents>"C:Program FilesMicrosoft.NETSDKCompactFrameworkv3.5binNetCFSvcUtil.exe" "https://localhost/DinnerNow/service/DeliveryService.svc"
Microsoft (R) .NET Compact Framework Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.5.0.0] Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'https://localhost/DinnerNow/service/DeliveryService.svc' using WS-Metadata Exchange or DISCO.
Error: An error occurred in the tool.

Error: Error in the application.

You might also see a similar issue if you run NetCFSvcUtil.exe on Windows Vista SP2 or Windows Server 2008 SP2.

Currently, there are no fixes available for this issue. The only workaround is to run NetCFSvcUtil.exe on Windows Vista (SP1 or earlier) or Windows Server 2008 (SP1 or earlier) and then copy the generated client code to other machines.

Habib Heydarian.

 

UPDATE: The Windows Mobile Developer team just released a patch that fixes this problem. You can download the new version of NetCFSvcUtil.exe from here.