You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the code in PR #612, I get the following errors trying some basic tests:
>>> import clr
>>> from System import Environment
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name Environment
>>> import clr
>>> from System import Array
>>> a = Array[int](100)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot convert 100 to System.Int32[]
>>> import clr
>>> clr.AddReference("System.Drawing")
<System.Reflection.RuntimeAssembly object at 0x7f0c58881990>
Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:09:58)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> from System import Array
>>> myarray = Array[int]([1,2])
>>> list(myarray)
[1, 2]
>>> from System import NullReferenceException
>>> try:
... raise NullReferenceException("aiieee!")
... except NullReferenceException as e:
... print(e.Message)
... print(e.Source)
...
aiieee!
None
@djoyce82@dmitriyse I got debugging using VSCode working in Linux - now trying to establish what is going wrong with the basic functionality. What is the code that usually prevents clr.AddReference() in Python from displaying the System.Reflection.RuntimeAssembly?
Activity
djoyce82 commentedon Feb 2, 2018
Other API calls do work though:
Cronan commentedon Feb 2, 2018
That works for me too - curious - I'm trying to get debuggers working in Linux to get a handle on what's going on ...
dmitriyse commentedon Feb 2, 2018
I am using docker, VS 2017 +docker tools + custom C# script for DTE and debugging works perfectly.
This an example of my script script for C# Interactive window.
You can try this approach.
dmitriyse commentedon Feb 2, 2018
Probably (when I will have enough time) I will inject this toolset into he pythonnet project.
dmitriyse commentedon Feb 2, 2018
This helps for managed C# code debugging.
Cronan commentedon Feb 2, 2018
@dmitriyse That's great, thanks 👍
djoyce82 commentedon Feb 5, 2018
FYI I've also had success debugging remotely by just attaching from Visual Studio:
https://blogs.msdn.microsoft.com/devops/2017/01/26/debugging-net-core-on-unix-over-ssh/
Cronan commentedon Feb 5, 2018
@djoyce82 @dmitriyse I got debugging using VSCode working in Linux - now trying to establish what is going wrong with the basic functionality. What is the code that usually prevents
clr.AddReference()in Python from displaying the System.Reflection.RuntimeAssembly?filmor commentedon Nov 8, 2019
Closed in favour of #984.