Service Connection List<T> vs Array bug

Greg Colton 1 Reputation point
2020-11-11T13:45:38.03+00:00

We have an asp website with service references to a WCF project. We have set the configuration of the service collection type to System.Collections.Generic.List, yet the reference.cs is showing arrays. We can see

<CollectionMappings>
<CollectionMapping TypeName="System.Collections.Generic.List`1" Category="List" />
</CollectionMappings>
in the reference.svcmap.

We would prefer to work with List if possible. What are we missing? Why is it insisting to build a reference full of arrays when it has been told to convert them to Lists?

Visual Studio 2019, asp.net 4.8

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,375 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,606 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Peng Ding-MSFT 91 Reputation points
    2020-11-12T02:56:10.64+00:00

    Hi @Greg Colton , I suggest you re-use "Add Service Reference" to generate proxy classes, and then set Collection type to list:

    39106-xyeyp.png

    In ServiceReference1 we can see the list:

    39079-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2020-11-12-100428.png

    Another method is to use the channel factory to call the service. This method avoids VS from converting list to Array. We don’t need to use VS to generate proxy classes to call WCF services. We only need to create the same Servicecontract and Datacontract on the client-side as the server-side and then create a channel to call the service. For more information about Channel Factory, you can refer to this link.

    If the problem persists, please tell me how you generated the proxy class. I suspect this may be a problem with the steps you generated the proxy class.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Tcstrackings 0 Reputation points
    2023-01-15T01:53:40.43+00:00

    Fortnite has today seen a brief period of downtime, as developer Epic Games rushed out a much-needed maintenance patch to fix a major issue with one of the game's most-used items.

    The Shockwave Hammer, introduced last month alongside the game's bumper Chapter 4 revamp, was disabled yesterday in several of Fortnite's competitive modes as a glitch which allowed players to repeatedly spam the item became rampant.

    Players have taken to social media over the past week to brand the game as "unplayable" after the glitch's use spread - allowing players to jump around the map non-stop, without the item's usual cooldown.

    Digital Foundry examines Fortnite Chapter 4.

    Fortnite's Chapter 4 update delivered Epic Games' fancy new Unreal Engine 5.1 visuals to the game, alongside a new Island map and a game-changing augment system. But fans have criticised the number of issues which have cropped up since launch that have forced Epic to pull items and functionality until a fix is found.

    Alongside issues with the hammer, Fortnite was forced to remove the game's new vaulting mechanic which let you automatically hurdle low objects.

    Epic Games also had to pull the game's Deku Smash ability - a scenary-demolishing anime-style energy attack that formed a major part of the game's recent My Hero Academia crossover event.

    To see this content please enable targeting cookies. Manage cookie settings

    Fortnite's next regularly scheduled content update, v23.20, is expected to arrive next week.

    0 comments No comments

  3. BadIcee 0 Reputation points
    2023-03-10T06:15:00.67+00:00

    We would prefer to work with List if possible. What are we missing? Why is it insisting to build a reference full of arrays when it has been told to convert them to Lists?

    0 comments No comments

  4. Khawaja Travel Multan IATA 0 Reputation points
    2023-11-10T06:22:40.1966667+00:00

    Ensure you:

    1. Update the service reference in Visual Studio.
    2. Confirm the WCF service on the server side returns collections as List<T>.
    3. Verify the service configuration uses System.Collections.Generic.List.
    4. Manually modify reference.cs if needed.
    5. Review DataContractSerializer settings.
    6. Use the latest Visual Studio updates.

    For persistent issues, check forums or contact Microsoft support.

    0 comments No comments

  5. Khawaja Travel Multan IATA 0 Reputation points
    2024-01-31T08:29:07.9366667+00:00

    "We would opt for working with Lists if feasible. What key element are we overlooking? Why does it persist in constructing a reference filled with arrays despite being instructed to convert them to Lists?

    0 comments No comments