SolvedPrivate

Develop with .net DLLs on linux & Python

Posted on 2014-10-20
11
21 Views
Last Modified: 2016-02-19
Hi Experts.


I want to have python scripts running on a linux box

The problem is, it has to feed from a DLL.
The dll was compiled on windows, but relies on .net4.5 framework


The reason. Working with robotics custom microcontroller, with the sdk developed in windows (relies on 4.5)

The processing is done on a pc, but want to move it to linux


Any suggestions to make this work?



thanks in advance
0
Comment
Question by:Ess Kay
  • 7
  • 3
11 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40393074
You will probably have to completely rewrite it.  There is the Mono project http://www.mono-project.com/   Also read the 'Compatibilty' page because Mono does not support all of .NET 4.5: http://www.mono-project.com/docs/about-mono/compatibility/
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 40393533
IronPython (https://ironpython.codeplex.com/) runs under Mono.  So if the .Net library you have doesn't rely on any features that Mono doesn't currently support, it should be possible to develop against it using IronPython on linux.
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40393620
i was thinking about that,  its not open source so i cant rewrite it.  supposedly it requires 4.0,  and cant be run on compact framework.
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40393622
iron python gives issues setting up,  wont build off git.  ive circumvented it by  downloading the exe file and,  and running it straight from mono.  have not tried to add the dll yet,  was wondering if there are other options
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40393638
just I suspected:



Traceback (most recent call last):
  File "/home/xxyyzz/Projects/projects/r.py", line 9, in <module>
IOError: [Errno 2] Could not load file or assembly 'System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.



Looks like mono/iron python setup doesn’t have the .net 4.0 accompanied System.speech
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 25

Expert Comment

by:clockwatcher
ID: 40393667
The mono status for the .Net namespaces is at http://go-mono.com/status.  System.Speech hasn't been touched yet and I doubt it will be for a long while.

If you're hoping to run this on a non-MS platform and require System.Speech it's not going to happen.
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40394580
what if i copy the speech dll
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40394582
or use winehq for . net 4.0
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 40395925
Copying the speech dll definitely won't get it working under mono.  System.Speech is going to lean heavily on the native Win32 Speech libraries (http://msdn.microsoft.com/en-us/library/ms723627(v=vs.85).aspx) -- which is why I'm guessing you might have problems with it under wine too.  I doubt that anyone using Wine has worked on porting/testing those libraries.  Ultimately it depends on their dependencies, so it might work, but IMO, at the point that you're copying Microsoft windows DLLs over to wine, you might as well turn to using a VM.  It's worth a try and I wish you luck, but I don't think there's a whole lot of chance that you'll get it to work.
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 40405650
still looking for alternatives.  may try to decompile
0
 
LVL 15

Author Closing Comment

by:Ess Kay
ID: 40708350
The true answer is, can't

The accepted answer has closest solution to obtaining goal, but due to the fact that these classes are reqritted and or adapted to mimic and use certain .net aspect, does not mean all classes are been adapted, and thus is not a complete solution
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now