1

How do I make a DLL (.NET) written in python code (IronPython)?

3 Answers 3

3

You cannot create a standard .NET .dll from IronPython code (.dll that can be used directly from C# or VB).

pyc.py produces .dll that can be used only by IronPython - check such .dll with Reflector and you will understand why.

Sign up to request clarification or add additional context in comments.

Comments

1

You can probably use ironpycompiler, using examples in http://pythonhosted.org//ironpycompiler/html-en/command-line.html. It requires installations of both IronPython and of CPython (the regular Python).

1 Comment

From the documentation: IronPyCompiler is a library for compiling IronPython scripts requiring modules from the Python standard library (or third-party pure-Python modules) into a stand-alone .NET assembly (a DLL file or an executable), using pyc.py.
0

You can use the script at C:\Program Files\[IronPython Program Directory]\Tools\Scripts.

3 Comments

The question is if I can compile them into portable DLLs
You mean DLLs that can be used from C#? I don't think that's possible. I could be wrong.
Yes, that's what I meant. but I meant it should be attached to the project, not to be called with <DllImport> or other tough way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.