New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#110: Made type lookup more robust. Fixed exception on .NET Standard … #111
Conversation
…ard 2.0 libraries.
Hey @mstyura. Thank you so much for taking the time to add this fix. Could you please make the tests run also against .net core 2.0? You'll have to add a |
@tpluscode I can do this (and already roughly tried), but what I can say is that issue is only reproducible during actual build. But not via test. So there is some critical different between test and actual build. But I'l add netstandard2.0 target to project and test (for other tests I guess it would be valuable). |
Interesting. Are you saying that current tests ran against netcoreapp20 would not fail? I'm going to try that myself right now |
Common/SystemTypesResolver.cs
Outdated
var runtime = AssemblyResolver.Resolve(new AssemblyNameReference("System.Runtime", null)); | ||
var core = AssemblyResolver.Resolve(new AssemblyNameReference("System.Core", null)); | ||
|
||
var typeType = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These sets of FirstOrDefault
are repeated a few times. Please extract these fragments including the null check and Debug.Write
into a method. Maybe something like GetTypeFromFirst(params AssemblyReference[] candidateAssemblies)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, will do
@tpluscode either I did wrong changes in my tests for .netstandard2.0 so the did not fail, or the test environment is different from build environment. |
@tpluscode have you managed to reproduce the original issue in your environment during build and test? |
Unfortunately not. That shouldn't stop me from merging this. |
Actually, you wouldn't have a repro of this, would you? |
@tpluscode I'm going to dive deep into how the current implementation of unit tests works to find out why they does not detect problem |
So the key difference is different
I think the best option would be 3, but I'll start with 2 since it looks like the easiest one. |
Great findings. Do you think it will be a lot of code? Maybe let's have it in a new branch? |
@tpluscode don't think that solution 1 would be easy, so dedicated branch (and probably github issue) is good way to tackle the problem. The solution 2: type lookup among type-forwarded types already implemented in this merge request and ready to be merged. |
@tpluscode would you mind publishing beta package to nuget with merged changes? |
Try the latest prerelease |
…2.0 libraries.