Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:16:45+00:00 2026-05-30T01:16:45+00:00

Is it possible to use svcutil to reuse/exclude referenced types, as with visual studio.

  • 0

Is it possible to use svcutil to reuse/exclude referenced types, as with visual studio.

I have multiple projects, my types/datamodels are stored in separate assemblies, so they can be used by other non wcf projects etc. When updating refrences in the visual studio gui, this all works out just fine. As long as a type is found on both sides of the border, it’s excluded from beeing defined in the proxy.

How can I achieve the same thing using svcutil?

More clearly I want to generate the proxy from a dll, not a running service which contains the servicecontract. At the same time I want to feed the dll files containing the shared types, which should be excluded from beeing defined in the proxy.

The reason for all this is for allowing my projects to be updated and built on a buildserver.

Edit:
First of thank you for your reply and suggestion of parameters. However I’m not getting svcutil reusing the assemblies following your instructions.

Here is parts of the .bat file I made I’ve excluded all the flags for generating INotifyPropertyChanged etc.

SET BACKENDROOT=C:\SomePath\Development\Backend\bin
SET DATAMODELSBASE=C:\SomePath\Development\DataModels\bin
SET COMMONBASE=C:\SomePath\Development\Common\bin

SET REFRENCED_ASSEMBLIES=/r:%DATAMODELSBASE%\Jall.DataModels.Consignment.dll

svcutil %BACKENDROOT%\Jall.Backend.Consignment.DLL /t:metadata
svcutil /o:test.cs %REFRENCED_ASSEMBLIES% *.wsdl *.xsd

The result is as follows:

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
   [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/KSD.DataModels.Consignment")]
public partial class ExtInvoice : OrmBase
{

private System.DateTime buyersOrderDateField;

private bool buyersOrderDateFieldSpecified;

private string buyersOrderNumberField;

private string compCodeField;
.....

And in the client it self:

public Address CreateNewAddress(int TK, string AddressType)

This is incorrect the datamodels are generated directly in the proxy. The client doesn’t just skip them and use the proper namespace for the types. The correct result should be:

public Jall.DataModels.Consignment.Address CreateNewAddress(int TK, string AddressType)

(Names are scrambeled 🙂 )

Brgds,
Stian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:16:46+00:00Added an answer on May 30, 2026 at 1:16 am

    Thanks for your help.
    Got this working eventually with the following commands:

    SET BACKENDROOT=C:\SomePath\Development\Backend\bin
    SET DATAMODELSBASE=C:\SomePath\Development\DataModels\bin
    SET OUTFOLDER=C:\SomeOutputFolder
    SET REFRENCED_ASSEMBLIES=/r:%DATAMODELSBASE%\Jall.DataModels.Consignment.dll
    SET REFRENCED_ASSEMBLIES=%REFRENCED_ASSEMBLIES% /r:%DATAMODELSBASE%\Jall.DataModels.SomethingElse.dll
    
    SET SVCFLAGS=/enableDataBinding /s /a /tcv:Version35
    
    ::Generate metadata
    svcutil %BACKENDROOT%\Jall.Backend.Consignment.DLL /t:metadata -d:%OUTPUTFOLDER%
    
    ::Generate proxy with shared types
    svcutil %OUTPUTFOLDER%\*.wsdl %OUTPUTFOLDER%\*.xsd %SVCFLAGS% /ser:DataContractSerializer %REFERENCED_ASSEMBLIES /o:test.cs
    

    Note that the /ser:DataContractSerializer had to be used for this to work.
    And another annoyance is that if types such as datatables/datasets etc is used (not that they really should though) their assemblies have to be included or svcutil will mess up generating the metadata.

    IE:

    SET SHAREDASSEMBLIES=%SHAREDASSEMBLIES% /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Use Visual Studio web.config transform for debugging I have an asp.net application
I have recently started looking into Google Charts API for possible use within the
I'm developing a website using Asp.Net 3.5 in Visual Studio 2008 and we use
what could be a possible use of declaring types within a namespace but not
I have reviewed DashCommerce, nopCommerce and DotShoppingCart for possible use and all of them
Is it possible to generate wsdl with use of SvcUtil or any other tool.
Possible Duplicate: Use of .apply() with 'new' operator. Is this possible? I have 5
Is it possible use mod_rewrite to resolve addresses hosted on another server? Say I
Possible Duplicate: Use SVN Revision to label build in CCNET I'm working through the
Is possible to use ArcSDE API in .NET(C#) ? http://edndoc.esri.com/arcsde/9.2/api/capi/dbconnects/dbconnects.htm Thanks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.