Title: Python.Runtime fails on .NET 4.5 and up · Issue #3 · pythonnet/pythonnet · GitHub
Open Graph Title: Python.Runtime fails on .NET 4.5 and up · Issue #3 · pythonnet/pythonnet
X Title: Python.Runtime fails on .NET 4.5 and up · Issue #3 · pythonnet/pythonnet
Description: Currently library fails on .NET 4.5. I know that 4.5 is not technically supported but the issue very painful because .NET 4.5 is update in place which overrides CLR. So, having it installed I don't really have an option to run it on ver ...
Open Graph Description: Currently library fails on .NET 4.5. I know that 4.5 is not technically supported but the issue very painful because .NET 4.5 is update in place which overrides CLR. So, having it installed I don't...
X Description: Currently library fails on .NET 4.5. I know that 4.5 is not technically supported but the issue very painful because .NET 4.5 is update in place which overrides CLR. So, having it installed I don...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/3
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python.Runtime fails on .NET 4.5 and up","articleBody":"Currently library fails on .NET 4.5. I know that 4.5 is not technically supported but the issue very painful because .NET 4.5 is update in place which overrides CLR. So, having it installed I don't really have an option to run it on ver 4. \nWhen I try to run an application that uses Python for .NET i get exception\n\nSystem.ArgumentNullException was unhandled\n HResult=-2147467261\n Message=Value cannot be null.\nParameter name: key\n Source=mscorlib\n ParamName=key\n StackTrace:\n at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)\n at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue\u0026 value)\n at Python.Runtime.GenericUtil.Register(Type t) in D:\\Users\\Barton\\Documents\\Visual Studio 2010\\Projects\\PySharp\\trunk\\pythonnet\\src\\runtime\\genericutil.cs:line 41\n at Python.Runtime.AssemblyManager.ScanAssembly(Assembly assembly) in D:\\Users\\Barton\\Documents\\Visual Studio 2010\\Projects\\PySharp\\trunk\\pythonnet\\src\\runtime\\assemblymanager.cs:line 266\n at Python.Runtime.AssemblyManager.Initialize() in D:\\Users\\Barton\\Documents\\Visual Studio 2010\\Projects\\PySharp\\trunk\\pythonnet\\src\\runtime\\assemblymanager.cs:line 60\n at Python.Runtime.Runtime.Initialize() in D:\\Users\\Barton\\Documents\\Visual Studio 2010\\Projects\\PySharp\\trunk\\pythonnet\\src\\runtime\\runtime.cs:line 166\n at Python.Runtime.PythonEngine.Initialize() in D:\\Users\\Barton\\Documents\\Visual Studio 2010\\Projects\\PySharp\\trunk\\pythonnet\\src\\runtime\\pythonengine.cs:line 118\n at Program.Program.main(String[] _arg1) in C:\\Users\\mitekm\\Documents\\Visual Studio 2013\\Projects\\TryPythonForNet\\TryPythonForNet\\Program.fs:line 54\n InnerException: \n\nI did some extra investigation. What happens is that this line of code fails\n\nhttps://github.com/pythonnet/pythonnet/blob/develop/pythonnet/src/runtime/genericutil.cs#L41\n\nbecause Namespace property is null on generic type EmptyArray`1 introduced in .NET 4.5. This type located in root namespace therefore Namespace property value is null. \nI made quick fix on \nhttps://github.com/pythonnet/pythonnet/blob/develop/pythonnet/src/runtime/assemblymanager.cs#L286\n\nto replace \nif (t.IsGenericTypeDefinition) {\n GenericUtil.Register(t);\n }\n\nwith \n if (t.IsGenericTypeDefinition \u0026\u0026 t.IsPublic) {\n GenericUtil.Register(t);\n }\nHonestly, I don't understand why the Python.Runtime process non-public type.\n\nIt worked on .NET 4 because this type EmptyArray'1 didn't exist there. As a matter of fact there were no generic types in root namespace.\n\nDo you plan to start taking pull requests soon?\n\nThanks, Dmitry\n","author":{"url":"https://github.com/dmitry-a-morozov","@type":"Person","name":"dmitry-a-morozov"},"datePublished":"2014-01-27T16:44:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3/pythonnet/issues/3"}
| 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:9b4c20ec-5327-dc23-bc4a-b548a13c3af6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCB6:27873:28D6080:39713CF:6971016F |
| html-safe-nonce | 44f75d47ea300478485ce7d310f72958577d07ec4e700a19adf126a01ea8e7a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0I2OjI3ODczOjI4RDYwODA6Mzk3MTNDRjo2OTcxMDE2RiIsInZpc2l0b3JfaWQiOiIzNjIwOTcwMjMwNDcwMjEzOTk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b5e58cfbea994875d258cbdbb4a6ef322d1f87fe64fc75aafbd902a40a132b87 |
| hovercard-subject-tag | issue:26367373 |
| 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/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e8441a458f40287175359d72b2700de03e891d21d083f24e9007e7340007775a/pythonnet/pythonnet/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e8441a458f40287175359d72b2700de03e891d21d083f24e9007e7340007775a/pythonnet/pythonnet/issues/3 |
| og:image:alt | Currently library fails on .NET 4.5. I know that 4.5 is not technically supported but the issue very painful because .NET 4.5 is update in place which overrides CLR. So, having it installed I don't... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dmitry-a-morozov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d17fd2bbd784dc91f3a78a2f1d2c41d9f4f8ce86136d09833e3cf21b2bde1b7 |
| 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 | e053d923fb27a9d948f8cefae8ba3bf43f7b938f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width