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

  • Home
  • SEARCH
  • 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 8549287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:41:21+00:00 2026-06-11T13:41:21+00:00

I am generating two service reference contracts for .asmx files in Visual Studio 2010.

  • 0

I am generating two service reference contracts for .asmx files in Visual Studio 2010.

I created both service references in an identical fashion. I right click on ‘Service References’ -> ‘Add Service Reference..’ -> ‘Discover’ -> Rename Namespace -> OK.

This is the top most auto-generated code from References.cs for the properly generated service:

namespace CableSolve.Web.Api.Tests.ComponentServicesProxy {
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="http://www.cormant.com/cswebapi", ConfigurationName="ComponentServicesProxy.ComponentServicesSoap")]
    public interface ComponentServicesSoap {

This is the code for the improperly generated service:

namespace CableSolve.Web.Api.Tests.WorkflowServicesProxy {
    using System.Runtime.Serialization;
    using System;
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="OrderDto", Namespace="http://www.cormant.com/cswebapi")]
    [System.SerializableAttribute()]
    public partial class OrderDto : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {

It is clear that WorkflowServicesProxy is using System.Runtime.Serialization where as ComponentServicesProxy is using System.ServiceModel.

I’m unsure what is triggering my second service reference to be generated using System.Runtime.Serialization. Does anyone know what would cause this? My OrderDto class does not have the DataContractAttribute, however, it does have other attributes:

[Serializable]
[XmlRoot("Order"), SoapType("Order")]
public class OrderDto : IDto

This service reference was generating code properly before. It seems that between two builds it shifted.

Declarations for both my services are identical:

[WebService(Namespace = "http://www.cormant.com/cswebapi")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class WorkflowServices : WebService

[WebService(Namespace = "http://www.cormant.com/cswebapi")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class ComponentServices : WebService

Service reference configurations are identical:

enter image description here

Update: While I tried the suggested answer without success, I have learned some information. If I remove all the code from my asmx file and re-generate the service reference, it DOES swap back to ServiceModel. So, there is something in the code itself.

  • 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-06-11T13:41:21+00:00Added an answer on June 11, 2026 at 1:41 pm

    You partially answered your own question

    My OrderDto class does not have the DataContractAttribute

    That combined with the fact that I bet that OrderDTO resides inside the assembly CableSolve.Orders and both the client and server share that assembly.

    Because it (technically) is a known type, and it is not explicitly marked as a data contract, the code generator uses the DLL’s reference and uses Runtime.Serialization to serialize and transfer the object instead of the ServiceModel.

    enter image description here

    As a “Solution” Change from “Reuse All” to the other option, and check all of the boxes except the one from your referenced common assembly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating a C# service reference using Visual Studio 2010 from my wsdl.
I have an requirement of generating two excel files at once. We are using
It seems that there are two methods for auto generating web service proxies in
Consider the following Visual Studio project structure ProjectA.csproj AClass.cs ProjectB.csproj References ProjectA Web References
I have a program where I am generating two double numbers by adding several
Below is my Code I am generating Password Protected pdf from ItextSharp. Actually two
For some odd reason, my project is generating two icons, same name, launches the
I am generating all dates between two dates. public List<Date> generateRangeDates(Date firstDate, Date lastDate)
I am generating a pdf for a client. This has two columns ... ID
I'm having trouble generating two independent random sequences using the rand and srand functions.

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.