RicoSuter / Namotion.Reflection

.NET library with advanced reflection APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XML Docs file not correctly resolved on some machines

RicoSuter opened this issue · comments

XML Docs file not reliably resolved (depending on OS/machine).

For more information see:
RicoSuter/NSwag#3465 (comment)

The big problem here is that the xml docs dlls in nuget packages (any external nuget and also asp.net core) are not put into the output folder so we need to look them up in the nuget cache folder, etc. this is super hacky at the moment. You can find the code here:

https://github.com/RicoSuter/Namotion.Reflection/blob/master/src/Namotion.Reflection/XmlDocsExtensions.cs#L801

There are also unit tests for this here to test or debug this on different machines:
https://github.com/RicoSuter/Namotion.Reflection/blob/master/src/Namotion.Reflection.Tests/XmlDocsExtensionsTests.cs#L598
https://github.com/RicoSuter/Namotion.Reflection/blob/master/src/Namotion.Reflection.Tests/XmlDocsExtensionsTests.cs#L611

The problem is that this works on some machines/OSes and does not on other, so the output is not stable...
Any better idea how to solve this?

Resolution can be disabled with XmlDocs.ResolveFromNuGetCacheOrDotNetSdk = false;