OData / ODataConnectedService

A Visual Studio extension for generating client code for OData Services
Other
79 stars 41 forks source link

CreateXmlReader() raises exception when multiple ressources have the same ending names #360

Open adrien-constant opened 1 year ago

adrien-constant commented 1 year ago

Describe the bug

With two services:

Creating an instance of MyService will faill because there are two XML metadata files in the assembly ending with MyServiceCsdl.xml

Version of the Project affected

ODataConnectedService all versions

Additional context

To fix quickly, simply replace this line var resourcePath = global::System.Linq.Enumerable.Single(assembly.GetManifestResourceNames(), str => str.EndsWith(filePath));

with var resourcePath = global::System.Linq.Enumerable.Single(assembly.GetManifestResourceNames(), str => "." + str.EndsWith(filePath));

habbes commented 1 year ago

Hi @adrien-constant thanks for pointing this out. Would you be willing to contribute a PR that fixes this issue. We'd be happy to review it.

Algorithman commented 1 month ago

over 1 year old now, just fix it already please.