Title: assemblymanager.cs: ResolveHandler finds assemblies based on StartsWith · Issue #533 · pythonnet/pythonnet · GitHub
Open Graph Title: assemblymanager.cs: ResolveHandler finds assemblies based on StartsWith · Issue #533 · pythonnet/pythonnet
X Title: assemblymanager.cs: ResolveHandler finds assemblies based on StartsWith · Issue #533 · pythonnet/pythonnet
Description: Environment Pythonnet version: All Python version: All Operating System: All Details Describe what you were trying to get done. Loading an assembly called MyAssembly. Assembly did not exist, should have resulted in an error, but instead ...
Open Graph Description: Environment Pythonnet version: All Python version: All Operating System: All Details Describe what you were trying to get done. Loading an assembly called MyAssembly. Assembly did not exist, should...
X Description: Environment Pythonnet version: All Python version: All Operating System: All Details Describe what you were trying to get done. Loading an assembly called MyAssembly. Assembly did not exist, should...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/533
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"assemblymanager.cs: ResolveHandler finds assemblies based on StartsWith","articleBody":"### Environment\r\n\r\n- Pythonnet version: All\r\n- Python version: All\r\n- Operating System: All\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\nLoading an assembly called MyAssembly. Assembly did not exist, should have resulted in an error, but instead it loaded MyAssemblyTest.\r\nThis can be done using Assembly.Load(\"AssemblyName\").\r\n\r\nEffectively this changes the way .NET normally loads assemblies and it ignores things such as strong naming. This could cause all kinds of unexpected effects in larger systems. \r\n\r\n```cs\r\n static Assembly ResolveHandler(Object ob, ResolveEventArgs args){\r\n string name = args.Name.ToLower();\r\n for (int i = 0; i \u003c assemblies.Count; i++) {\r\n Assembly a = (Assembly)assemblies[i];\r\n string full = a.FullName.ToLower();\r\n if (full.StartsWith(name)) { // this is a problem!\r\n return a;\r\n }\r\n }\r\n return LoadAssemblyPath(args.Name);\r\n }\r\n```\r\n\r\nThe FindAssembly method has obvious issues as well, but it only searches inside the python path, so the effect there is limited. The ResolveHandler searches through all currently loaded assemblies, which is a bigger problem.","author":{"url":"https://github.com/rmadsen-ks","@type":"Person","name":"rmadsen-ks"},"datePublished":"2017-08-30T12:08:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/533/pythonnet/issues/533"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8f95a227-26df-242d-f2b6-169482d94a21 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E414:129B62:1DAAFA3:29C95DF:6970E675 |
| html-safe-nonce | eefac191b996ee4877a195a009bdc47c753ce040ea08d3610e30d4105017b8fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDE0OjEyOUI2MjoxREFBRkEzOjI5Qzk1REY6Njk3MEU2NzUiLCJ2aXNpdG9yX2lkIjoiNzkyNDIxMzc2OTUzNTgwOTE0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 394af471e18b0a3a4cc5e3dc8cacf064576b8536f1d5f762dd8a9288a8df11ea |
| hovercard-subject-tag | issue:253975223 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/533/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0a3892af6394aed50d691d6152e1e8691fb05330aa37cb8d26881a96d6f8b52/pythonnet/pythonnet/issues/533 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0a3892af6394aed50d691d6152e1e8691fb05330aa37cb8d26881a96d6f8b52/pythonnet/pythonnet/issues/533 |
| og:image:alt | Environment Pythonnet version: All Python version: All Operating System: All Details Describe what you were trying to get done. Loading an assembly called MyAssembly. Assembly did not exist, should... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rmadsen-ks |
| hostname | github.com |
| expected-hostname | github.com |
| None | a8b3a33ad16bd33428ccc7800d4ea7bfc6b4990584847afdcb92b020b61a949b |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b8a8c883a585a3dc6cb57fa8b7997b70c86a696c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width