Skip to content
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

DependencyContext null #8

Open
dsjohnston opened this issue Apr 24, 2019 · 1 comment
Open

DependencyContext null #8

dsjohnston opened this issue Apr 24, 2019 · 1 comment

Comments

@dsjohnston
Copy link

Using an application that is .netfull only (UI or UnitTest), one can get a NULL DependencyContext. causing the 'Init' function to throw an NullReferenceException. This occurs due to the lack of a manifest file.

Consider null check + warning: "return context == null ? new List() : context"

return context.RuntimeLibraries

@rgarofalo
Copy link

change code with :

Assembly[] a = AppDomain.CurrentDomain.GetAssemblies(); return a.Where(x=> x.GetReferencedAssemblies().Any(y => referenceAssemblies.Contains(y.Name)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants