- This works on Windows only and I can't get compiled Python DLL to target .NET 5 due to the reason in this GitHub issue
- Installed Visual Studio 2019
- Installed .NET Framwork 4.8
- Installed IronPython for Windows
- A sytem path variable contains
C:\Program Files\IronPython 3.4
folder.
- Clone the project.
git clone git@github.com:dotnetthailand/iron-python-examples.git
- CD to
iron-python-examples
folder.
cd iron-python-examples
- Double click
IronPythonExamples.sln
to open the project with Visual Studio. - The current project file/folder structure.
iron-python-examples/ ├── IronPythonClassLibraryTest.cs (the main test class) ├── IronPythonExamples.csproj ├── IronPythonExamples.sln ├── Math.py (Python code which will be compiled to Math.dll by ipyc.exe)
- In the Solution Explorer window, select project
IronPythonExamples
node. - Press
Ctrl+Shift+B
to build the project. - Open
IronPythonClassLibraryTest.cs
, and click somewhere insideSum_ValidInput_ReturnCorectValue
test case. - Press
Ctrl+R, T
to run the test case. - The Test Explorer window will be automaticall opened and it will show a status of the running test case.
- You should find a successful test result as the screenshot below.
- OleViewDotNet, search by ProgId "ThaiTranslite"
- C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\oleview.exe after you have installed "development with C++" from Visual Studio Installer.
- RegDllView
- RegistryFinder
- https://www.py4u.net/discuss/736777
- https://www.codemag.com/Article/2009101/Interactive-Unit-Testing-with-.NET-Core-and-VS-Code
- How to Register and Unregister a DLL or ActiveX Controls Using Regsvr32.exe
- How C# new dynamic type can simplify access to late bound COM object
- https://adamtheautomator.com/regsvr32-exe/
- C# interop with C/C++ and Rust in WebAssembly