I am a .NET Windows developer who is completely new to Linux. I recently built a very simple application in MonoDevelop on the Raspbian image, for use on that same image. Everything works fine when I run the project, but when I build it then try to open it outside of the IDE, it tells me it's a DOS/Windows application. How do I build it so that it will run on Raspbian?
Sorry. Can't ad comment to your comment.
I am at beginner level of Linux, but had encountered issue with the paths of some versions. Probably sudo uses different paths than the regular user. Sudo is not just elevating the permissions, but may contain different settings. If you "fix" the paths than the app might work also without the sudo.
Related
Currently I'm developing an application for both Windows and MacOS.
Created a template application for MacOS (10.13.4) using Eto.Platform.Mac64 (2.4.1) nuget package. The application is built for Release build. The problem occurs when trying to launch the .app bundle.
Currently tried:
Opening the bundle using: open -a xxx.app. I got an error -54
using: sudo open -a xxx.app. The error is -10810
Giving all permissions for files inside for execution.
Disabling GateKeeper
Trying to launch the executable directly using mono, although the ETO platform checks if it's launched from .app bundle, and fails there
Launching the .app from /usr/local/bin
Launching the .app from ~/Applications/
Building Eto.Forms for MacOS separately.
Everything seems to point to permissions issue, but I can't seem to understand what am I missing.
Since I'm new with MacOS in general (mostly familiar with linux), any suggestions/help is greatly appreciated.
After checking the Console.app for logs I found out that com.apple.quarantine had marked the application as quarantined.
After xattr -d com.apple.quarantine MyApp.Mac.App/Contents/MacOS/MyApp.Mac
Everything works perfectly.
Thank you Curtis for your suggestions.
I have made a Kinect Application in Microsoft Visual Studio 2010. I need to make an exe of the application which can run on any windows based system. If I need to do that than is there any requirements that the system should fulfil? and If yes, then how do I do that?
I tried to use the exe in application/bin/debug/application.exe by copying it in another folder but it shows an error but if I run the exe from the bin/debug/application.exe it works. Am I missing something here or is it the only way to do that?
"Any Windows based system" isn't going to work. Assuming you're using the Kinect SDK, it will only run on Windows 7 (and supposedly Windows Server 2008). The computer running the application will need either the Kinect Runtime, which only works with the new Kinect for Windows sensor, or the Kinect SDK, which also works with the Kinect for Xbox. Microsoft wants to sell more Kinect for Windows sensors, so they don't allow the runtime to work with the old Xbox Kinects. Makes sense in a way, but man that bugged me when I first found out about it. There's a short post showing how to test for the existence of the Runtime on application load, so you can show an appropriate error message instead of just crashing out.
You need to copy any files that the program relies on, such as DLL files, along with the executable. There's instructions here for how to embed the DLL files into the executable; I've not tried it but it might be worth a shot.
The correct .NET version should be installed when either the Runtime or the SDK is installed; you shouldn't have to worry about this.
#Coeeffect is right, but you can also publish version 1.0.0.0 of your app by going to project -> properties -> publish -> publishing wizard to publish your application to then use on ther computes ect. Hope this helps!
You need to copy all non-standard DLLs that your program uses.
The target computer needs the appropriate version of .Net.
I'm a long-time C# developer but new to Mono and, especially, Gtk#. I have developed a small app using C# and Gtk#. I need this app to work on Windows, Linux and Mac so I decided to go for Mono and, so far, it seems to be a cool framework.
What my simple app does is start up an XSP web server based on a local directory and port chosen by the user. Ideally, I would like my app to work without having to install the Mono framework at first, but this is not a must to begin with. I am using the following libraries:
using System;
using Gtk;
using System.Net;
using Mono.WebServer;
using System.Diagnostics;
I am developing on a Mac (Snow Leopard, 10.6.7). My executable works perfectly on my Mac. But I am having problems with Ubuntu and Windows. My app works partly on Ubuntu (11.04) -- it starts up and seems to be working but fails when I try to start the XSP web server, which seems expectable as Mono.Webserver is probably not installed on my Ubuntu machine. On Windows (7, 64-bit), my app crashes immediately when I double-click on it. The crash report tells me that a System.IO.FileNotFoundException error occurred. Probably due to the same missing XSP library?
Anyway, I looked around on the Internet and learned about mkbundle. I have performed the following setting as suggested by various forum threads:
export AS="as -arch i386"
I have navigated to the /bin/Release directory of my project and, then, run the following command:
mkbundle MivandoLocalServer.exe -o MivandoLocalServer --deps
But I am getting the following output, which eventually fails:
Compiling:
as -arch i386 -o temp.o temp.s
cc -g -o MivandoLocalServer -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o
Package mono-2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono-2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mono-2' found
temp.c:2:36: error: mono/metadata/assembly.h: No such file or directory
temp.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘assembly_bundle_MivandoLocalServer_exe’
temp.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
temp.c:18: error: ‘NULL’ undeclared here (not in a function)
temp.c: In function ‘mono_mkbundle_init’:
temp.c:22: warning: implicit declaration of function ‘mono_register_bundled_assemblies’
temp.c:22: error: ‘bundled’ undeclared (first use in this function)
temp.c:22: error: (Each undeclared identifier is reported only once
temp.c:22: error: for each function it appears in.)
temp.c: In function ‘main’:
temp.c:114: warning: implicit declaration of function ‘mono_set_dirs’
[Fail]
I really do not know what to do from here. I have MacPorts installed and I have read that this might cause some problems with regards to the pkg-config directory. Is this true? If yes, what will I have to do make it work?
I hope that somebody will be able to help me. Thanks!
Best regards,
Sebastian
PS. I have also posted this question in the forums at Mono's homepage but without any responses so far.
Update: I suspect MacPorts for interfering with my pkg-config directory setting. When I entered the following commands into my terminal, mkbundle allowed me to compile. But I am still encountering some problems.
export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig/"
export AS="as -arch i386"
export CC="cc -arch i386"
Executing the following mkbundle command results in a Unix-archive of 4.9 MB that includes all the necessary dependencies. When I double-click on this new file on my Mac, a terminal window pops up and starts my app. Sweet! But this does not work in Windows nor in Ubuntu.
mkbundle MivandoLocalServer.exe -o MivandoLocalServerBundle --deps -z
What I would like to receive is a bundled executable that can be run in Windows and Ubuntu. So far I have not come across a solution that lets me do this. I tried to install MonoDevelop on my Windows 7 machine, copy my solution and build it there. But since my app is dependent on the Mono.WebServer2 library, I am not able to build it on Windows. I have not been able to find the Mono.WebServer2.dll to download for Windows anywhere on the Internet.
First of all this situation covers two separate issues which I will address separately:
Architecture - i386 only
Build and Packaging
1. Architecture
First of all, not all Windows and Linux machines run on the i386 architecture, so make sure you are using one that is. They are more likely to be i386, but Linux can easily run on many architectures and Windows has recently ventured into this path as well (they supported it in the past, but it quickly lost support) with the new tablet PC cpu types.
2. Build and Packaging
When targeting any operating system there are bound to be differences in the packaging paths so you should build for each target OS with that target OS. If you want mkbundle to work on Windows the whole toolchain needs to be installed there and Windows requires a special script to get it right, but since mkbundle was made for Unix-like OSs it should work on Linux without special considerations:
Create C# executable with mkbundle on windows
http://linux.die.net/man/1/mkbundle
We are building an application on .net, And it is an Image Viewer application uses .net 3.5.
And this application will be on a CD along with other images.
My Question is, is it possible to Auto Run this application when you insert a CD on a machine which DOESN'T Contain .NET Frame Work.
Or any other ways of building the application which runs from the CD.
Autorun is a feature of Windows. It does not have anything to do with .NET really. You can use it by placing apropriate files in the root of your CD.
See: http://en.wikipedia.org/wiki/AutoRun
In order to execute a .NET app WITHOUT .NET framework installed, point the Autorun.inf to an installer of you application, which would be deployed on the CD as well.
The application will fail to run directly when it cannot find the libraries it need.
What you can do is to create a non-.NET dependent bootstrapper, include the framework installer.
So when the CD auto run, run the bootstrapper, the bootstrapper will run the installer. Once installed, run the application.
No, you can't run .NET applications on a computer without the .NET Framework installed. That's a hard rule, and a pretty intuitive one, it seems to me. Somehow, this question still gets asked a lot.
But Auto Run has nothing to do with the .NET Framework. It's a feature provided by the Windows operating system designed to run your setup/installation program directly from the inserted installation medium without requiring any kind of user interaction.
So what you should be doing is creating a setup program for your .NET application. You can do this from within Visual Studio: just create a Setup Project instead of a Windows Forms Application. The setup program will take care of detecting whether or not the computer has the appropriate version of the .NET Framework installed, and installing it if necessary along with the application. The setup bootstrapper will be able to run without the .NET Framework installed, so you can create an autorun.inf file that simply specifies setup.exe as the application to be launched automatically.
I've used mono to do this a few times, not with the static linking as mentioned in the other answer, but by including the mono distribution on the cd (or a subset of it). Mono doesn't seem to do much in the way of modifying registry, system32, etc. So you can do an xcopy deployment of if, or CD deployment in this case. You'll end up running mono.exe
I think Mono supports some form of static linking that doesn't require installation. But I never tried it myself.
When I try to run my Mono C# programs in MonoDevelop on an external console, I get the following error.
http://i146.photobucket.com/albums/r248/bobber205/error.jpg
(First time needing to post a pic here on stackoverflow, sorry if this isn't correct to just post a link)
:)
It runs on windows's regular "cmd" console when I debug with input working as well.
I've tested an older version of mono and this feature worked. (Note I get this error on both Windoows Vista, Windows 7, and Mac OS X).
Any ideas on how to give it that "filename"? I thought maybe beta 2 would fix this but I guess not. :P
I'm pretty sure that MonoDevelop uses xterm & bash for the "external console", which won't work on Windows, and might have problems on Mac. It needs to be abstracted out to use native consoles for these different platforms.
Please file a bug: http://monodevelop.com/Developers#Reporting_Bugs