Cannot launch picoe/eto application on Mac OSX - c#

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.

Related

Docker Desktop is not functioning as expected. Please try restarting Docker

I created a .net core 5 web api and planned to run using docker
with Visual studio 2019. While trying to run api in docker end up with error,
Docker Desktop is not functioning as expected. Please try restarting Docker.
I was not able to run the application in windows my local system.
Well, I suppose you get this because your VS is not able to communicate with docker daemon which opens a net.pipe. To justify this try the below command in a command line:
>docker run hello-world
Regardless you have a "hello-world" container, if you get the following error: "Error response from daemon: open \.\pipe\docker_engine_windows: The system cannot find the file specified".
This means you are probably missing some Windows features. Run the following command from an elevated Powershell:
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
Then it will ask to restart your computer, then docker stuffs shall work from VS.
I had this problem recently and used this GitHub issue which helped me solving the problem. Hope this helps on you too...

How to publish a Windows-compatible executable from Mac?

I just finished my first C# console app on Visual Studio 2022 on Mac and I need to publish it to a standalone executable app. I am able to get the exe on Mac working fine. But my teacher needs to open it on Windows. How can I do that?
When publishing, VS on Mac does not ask for the target runtime machine at all...
Thanks.
Sure, you can always publish for a different platform, e.g:
dotnet publish MyProject.csproj --runtime win-x64
This should give you a publish\win-x64 directory with a windows exe file in it. You can give that folder to your teacher.

How to build a WPF app so everyone can install and use it

I am entangled in how to work so that after I finish building the wpf app, I can give it to another computer by downloading the app (for example, downloading the .exe file). I also tried it, but when I ran the .exe file, it only showed a popup cmd and then disappeared. Then I have pulish with self-contanied deployment mode. Here is an image of the following files when I published at bin\release:
Path: C:\Users\ASUS\Source\Repos\UserService\WpfApp1\bin\Release\netcoreapp3.0\publish
If I run the .exe file in a folder then run normally. But when I copy it to a deskop and run it is still the same (can't run).
I want to ask how can I help my app to be used by other computers. Thank you mn! Forget more, my app is using .net core 3.0 already.

C# MonoDevelop -- build for Raspbian

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.

Using mkbundle to port Mono GTK# app to other platforms

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

Categories

Resources