I have developed a project with VS on Windows 10. Right now on Linux mint i am debugging the project with MonoDevelop and it runs just fine.
Let me show you:
However when i make a build and i go to the Release folder and then i try from the terminal to launch the program i have a problem. Let me show you first the files i have build:
Then i go to the directory with my terminal and i run:
chmod +x ./WorldServer.exe then i run ./WorldServer.exe
and i receive the following error:
I know that this is .exe file and maybe i have to build a different type of file. But i am not really sure what setting should i apply in my project to make a working build for linux.
As far as i know linux is using .so as extension for it's libraries. However it is generating .dll files. Can i change that? Can i somehow make my project to be "buildable" in the two OS Linux and Windows ?
The exception tells us, you need System.Management in your project. It isn't there.
Why?
Because Mono, according to there Road-map, doesn't support this:
The following do not map to operating systems other than Windows, and
we are unlikely to spend time to support them even on Windows:
System.Management
How?
System.Management is a library that only works on Windows. The MySQL connector driver has started to depend on this library and tries to load it per reflection.
I'm not into this whole MySql Progess but there is an open bug for it. Also there is a comment which says:
The last working version of the MySQL .NET Driver is 6.4.6
I hope this helps you.
Related
I am using C# WebDriver to automate a web application. Everything is written targetting Windows already. But now there is a need to get it ready for Mac as well. Selenium webdriver launches Chrome using ChromeDriver.exe. This exe can be launched in Windows using C# Process class; but not in Mac using the same class in Mono. The solution seems to be building ChromeDriver in Mono. I have got the ChromeDriver source from github. But having difficulty in building the same.
The problem statement is: how to build ChromeDriver.exe with Mono. I am using Xamarin Studio (which is the Development IDE I am using to develop in C# on Mac). So my aim is to load the ChromeDriver sources in Xamarin Studio and build it. But when I pulled the sources of ChromeDriver, I see several C files without any project file, as in *.vcxproj. Searching on this topic what I find out is that it could be built using Ninja. There is some command "ninja -C out\Release chromedriver" that is going to do it for me. So I fetched the Ninja sources from github. But when I try to run the build command, then it complains out/Release File or Directory not existing. It is indeed not existing inside the folder where I fetched Ninja. The only information I have is that the out folder will be there once I generate the Ninja files. But I am completely ignorant about how to do it or what are the pre-requisites for it.
Coming back to why I need it: In the selenium webdriver code the ChromeDriver is launched using C# process class.
Process p = new Process();
p.StartInfo.FileName = <Full Path of ChromeDriver.exe>;
p.UseShellExecute = false;
p.Start();
This C# code snippet works in Windows, but not on Mac. I use Xamarin Studio to debug it. And the error I get at the line p.start() is "No process attached to the object p". Next I build a simple console application in C# using Xamarin Studio on Mac; i.e. the output exe is built with Mono framework. And I use this exe's path instead of ChromeDriver in the above code. And p.Start() gets executed successfully with no error.
Hence the problem comes down to having a Mono version of the ChromeDriver.exe. In chromedriver's site they have ChromeDriver.exe for Windows, ChromeDriver.dmg for Mac but no Mono version of it. I am looking for any of the 3 following solutions:
1. If the ChromeDriver.exe built with Mono is already there somewhere uploaded, nothing better that that.
2. The steps I can try to build the ChromeDriver sources
(https://github.com/scheib/chromium/tree/master/chrome/test/chromedriver)
with Mono.
3. Skip building it altogether and find some other way to launch the ChromeDriver.exe in Mac.
I am scratching my head with all these for the last couple of days :( . Any help will be largely appreciated! Do let me know if any more info is required. Please help..
Thanks in advance,
Deb
sorry for being absent for a year! Really appreciate your concern.Yes, finally I was able to do it. Downloaded the Mac version of chromedriver from http://chromedriver.storage.googleapis.com/index.html. And simply used it in my C# (mono) code written in the Xamarin Studio. And I was able to invoke the ChromeDriver using the usual "SeleniumDriver = new ChromeDriver(driverLibrary);" statement. But I had to make some more changes in the C# code at multiple places to make the entire Automation framework work on Mac. I forgot the finer details but remember it was fun! People were excited to see Webdriver+Mono doing it on Mac!
I searched around but I could not find anything on this.
I have programmed a c# application in VS 2010, targeted to .NET Framework 4.0. It has a .DLL and a few config files which I have being copied to the output directory upon compilation. It works great on my computer, I have .NET 4.0 Extended and .NET 4.0 Client installed. I set the build configuration to "release" on "any CPU".
After it compiles I copy all the files from the release directory to a folder on a shared drive, so that multiple computers on the network can execute it. When I execute it from the computer that I used to develop it, it runs great. When others try to execute it starts but just shows a small blank form, and that's it. I make sure that they have .NET 4.0 installed (Both Extended and Client, though I think the full version is what is really required).
I can't for the life of me figure out why it does this.
All machines are running 32 Bit Windows Vista SP2.
Any thoughts? Much appreciation for any help.
It can be a lot of things. First, like one comment, you should do a quick Deployment project and try to install on another computer to see how it work.
If you can't do that, here a couple of things to check:
It can be a network permission problem. I've seens an .NET application that could not be executed on the network for x reason but worked on the desktop. To check, make sur your user copy it on their computer before executing.
I don't think it's a .NET problem because it wouldn't let you start the application.
My guess is that one of your control/library (the one that is not showing) does not have the proper reference when run from another computer. To check, run the application "Dependency Walker" (you can find it on google) and see what DLL are missing from other computers.
That's all I can think for now ! Good luck! You just have to use ellimination method and you will find the problem.
I have a c# program I wrote. I want to run it on Mono on CentOS 6. What are the steps I need to take to compile it? I read some steps using xbuild which I could not get to work, some steps using gmcs, etc. Nothing working right now.
A simple and to the point guide would be good. I ran it through a Mono Analyzer and it did not give any errors for Mono, so it should be good to go.
Well you shouldn't have to special compile it at all as long as it doesn't have a GUI (meaning it's just a console app), or that GUI is a simple Windows Forms or GTK#. Mono will run a regular C# program on the console just fine. There is some quirkiness with Windows Forms, which was never fully finished, but generally you should just be able to compile using VS 2010, copy the dll's and executables to the system you want to run it on, and run 'mono myprogram.exe'. We run several older programs we have this way.
To run a .net program under mono all you have to do is to copy the .exe file with all depending dlls to the mono machine and run the application with:
mono myprogram.exe
if this doesn't work, something with your code doesn't work with mono/Linux.
As you mentioned in a comment, you got some IO errors, that could be because you trying to connect to COM1 or something like that. COM doesn't exist in Linux, as I'm sure other stuff doesn't either (I'm a very beginner with Linux ^^).
Maybe you should try to Console.WriteLine() at some points off your code. That's a good way to "debug" without debugger ^^
Well, I'm getting started in applications android development, as I'm familiar with C#.NET(and I love it), I decided to use the fantastic MonoDroid project. I downloaed and installed,worked fine until now. I created hello world application, using MonoForAndroid_API_8 emulator device, worked fine.
then I copied *.apk files and installed in my tablet with android OS 2.2, but when I run my application,I get the following error:
The xx.xx application (xx.xx process) stopped unexpectedly. Try again.
how to fix this? Any help is very appreciated. Thanks in advance.
You can find information here about how to view the Android logs.
I'll take a guess at what your problem is though, without having seen the logs. Are you using the full version of Mono for Android or the evaluation? The eval doesn't support deploying to an actual device.
If you are on the full version, is the APK from a debug build or release? Debug builds are made to use a shared runtime to make deployments quicker, but it means that the APK doesn't contain everything the app needs to run. Release builds don't use the shared runtime, so the Mono runtime is bundled with the APK.
I'm using MonoDevelop 2.8.5 and I'm trying to compile a moonlight application, but it fails. I created a brand new Moonlight Application Project and tried to compile it, but it fails with the following error.
Error: Framework 'Moonlight / Silverlight 4.0' not installed. (MoonlightTest)
In this question from October 2011 one of the developers of MonoDevelop states that is not possible to do this without some major hassle.
Is this still true with the new version(s) of MonoDevelop out?
If so, how can I compile Moonlight Application Projects in MonoDevelop if I'm willing to go through some hassle?
This is a bit of "psychic debugging" but I've run into it a lot in linux and imagine you might have the same problem happening on OS X. Is the compiler that Monodevelop is looking for exactly the same as the version you installed? It might be something as simple as the folder being called Moonlight1.3 vs Moonlight1.3.1. Look at the build output and see what version it is looking for then look in your applications folder (via terminal the app folder in the finder might hide the info) and check that they are the same.