Sharing WCF types using VS 2008 doesn't work

I am trying to pass DTOs from my datalayer assembly between client and WCF service. This works using svcutil, but doesn't work using VS2008. VS2008 generates its own DTOs while svcutil uses a generic data type.

The svcutil options I have used are as follows:

"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SvcUtil" 
          /serializer:DataContractSerializer
          /language:vb 
          /out:ServiceClient.cs
          /namespace:*,CommonWCF 
          /noconfig
          /reference:"D:\trunk\DataLayer\bin\Debug\DataLayer.dll"
          /collectionType:System.Collections.Generic.List`1
          http://localhost:3371/Common.svc

      

I read that VS2008 just calls svcutil behind the scenes, so why isn't it working? I really want to avoid adding a manual process to the build process.

0


source to share


3 answers


I created a batch file that calls svcutil and added it as a prebuild task to avoid manual handling. This solved my problem, but I still don't know why there is different behavior between svcutil and vs2008 gui.



0


source


Just use ClientFactory<T>

.



You don't need svcutil or a service reference. The code they generate is just a bloated wrapper around the ClientFactory that adds little or no functionality.

+4


source


If you avoid using a service reference and just include a reference to the generated svcutil code, then that should avoid this problem. Our DTOs are in shared assemblies.

0


source







All Articles