ODataConnectedService
ODataConnectedService copied to clipboard
CreateXmlReader() raises exception when multiple ressources have the same ending names
Describe the bug
With two services:
- MyService
- AnotherMyService
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));
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.
over 1 year old now, just fix it already please.