Porting C# .net to run on OSX - c#

I was looking through this http://www.mono-project.com/docs/gui/winforms/porting-winforms-applications/ to see if I could port it but it seems MoMA is no longer updated. Is there something newer to check with?
My program is fairly simple, it however uses a WebBrowser control and I think that might be my issue with porting it. Is there any support for WebBrowser in OSX? Is there a good alternative?
Thanks

Try with first installing Visual Studio on Mac (as mentioned in comment). Then create a fresh .NetStandard or .NetCore project and transfer all your files to this new one. The start compiling and resolve any porting errors you get.

Related

Importing winform solution to mono (linux) from VS Code (windows)

I tried to import a winform solution file from VS code (windows) to monodevelop (Linux) but it failed. The error is as follows:
Error while trying to load the project '/home/virtuall_kingg/Camera_GUI/Camera_GUI/Camera_GUI.csproj':
File not found: /home/virtuall_kingg/Camera_GUI/Camera_GUI/Camera_GUI.csproj
I added Camera_GUI.csprojfile also but still the error is same.
Can anybody guide me on how to import solution to mono?
This winform project has become pain in my neck.
Is building the GUI using gtk# in Ubuntu from scratch is the only way?
EDIT: Now you can substitute mono with .NET 5, the common .net framework for all platforms.
You are asking multiple questions here. In Linux you have (limited) support for WinForms through Mono. Depending on how complex is your project, you could port it without modification. If there are p/Invokes, then you won't for sure be able to port it.
Yep, in Linux the "other" big option is Gtk#, which has a long history. If you would want to port the project starting from scratch, it'd be a good option, but it'd involve porting your classes from working with WinForms to Gtk#, which is not impossible, but not trivial either. The feasibility of this would mainly depend on how good that project is architected. Do you have bussiness logic and views separated? If the answer is no, then the process will be tedious, and as hard as lengthy.
MonoDevelop is an IDE for C#, and Visual Studio for Mac is roughly MonoDevelop. It certainly works in Linux... as well as Visual Studio Code. So, there is no need to change anything in that front if you just need to port your code to Linux.
Okay, now, what's the road to follow? I think the best one is to try Mono with WinForms. It'd maybe involve simplify some code in the user interface part, but is certainly feasible. Just remember that you need to install Mono, and if your project is set to target .NET Core, then you need to create another project from scratch and set it to target .NET Framework.
Now, the specific question is that MonoDevelop complains about a missing Camera_GUI.csproj. This means that you've only picked a few files, but not the whole solution. Any IDE (Visual Studio, Visual Studio Code, Rider...), would complain about the same thing. Either remove the project from the solution, or add the project with all its files to the directory in which the solution sits.
So, the answer is: don't change anything if you don't need to retarget your project. Just move to a Linux box or virtual machine, with the whole project and open it in Visual Studio Code Rider, Rider, or MonoDevelop it does not matter. From within the IDE, remove those projects that make no sense in Linux (i.e., windows installer), and then recompile and start the program. Polish those parts of the user interface that need tweaking and that's it.
Should you need more help, please be more specific and provide more info.

Couldn't find the required information in the lock file. Make sure you have .NETCore,Version=v5.0/win10-anycpu mentioned in your targets

I'm working on a Windows 10 universal app. The aim was to have a JS front end connecting to a C# library for the heavy lifting. Though when I add the reference and trey to compile I get the following error
Couldn't find the required information in the lock file. Make sure you
have .NETCore,Version=v5.0/win10-anycpu mentioned in your targets.
I've looked around and in a few cases the solution has been to update Visual Studio and the NuGet packages which I have done.
Any suggestions would be great,
Thanks
Just change build configuration to x86 or ARM and it should work.
Any CPU is not supported by UWP projects, because they are built using .NET Native. You can read more about it here.

Deploy Mono application without Framework on Mac

I have a c#-program, that works well under Mono and on OSX, I also was able to create an app-directory for that program. Now I want to distribute it, but I don't want to force the user to install mono, since this is unusual under Mac (and has some side-effects, that I want to avoid).
I already tried to build a bundle with mkbundle, but mkbundle doesn't work correctly under Mac.
I should add, that I use GTK.
What is the easiest way to build a compleley independent app under Mac? Is there any good tutorial? Is there a good tool, that could help?
Ask Miguel (December 9 2010 blog post)
MonoMac: we just released MonoMac 0.4 and we are now adding support for creating self-contained application bundles that developers can redistribute themselves or even submit to the Apple AppStore for MacOS.
MonoMac has been a lot of work, mostly, due to popular contributions. There is a nice emerging community of new contributors to Mono that has sparked in the last few weeks.
Did you try macpack?
http://www.mono-project.com/Guide:Running_Mono_Applications
It should be possible to use mkbundle in the linking of mono assemblies to produce a "portable app" with no requirement on installing the runtime.
http://www.mono-project.com/Linker

Anybody else using MonoDevelop?

I'm starting a new project in MonoDevelop, and I want to see how other projects are using it.
I tried searching through SourceForge, code.google.com, etc., but mostly I was just finding things like add ins or something related to MonoDevelop itself.
So is there anyone else using MonoDevelop, especially open source?
Basically, MonoDevelop is designed to function very similar to Visual Studio, including using all the same sln/proj file types. You can take a VS solution, open it in MD, and hit F5 to run it, and vice versa.
Because of this, I don't know that many people are going to write about "how they use MD as part of their project" any more than someone is going to write about how they use Notepad.
Any project that is using sln/proj files on Linux/Mac is likely using MD.
MonoDevelop is multiplatform IDE, especially for Linux. Works with Visual Studio solution and project files (100% both direction compatibility). So you can't find project using it. Any C#/VB.NET project can be developed in MD.
Three years ago me and a friend started work a new mono project and tried to use MonoDevelop for it. However - this was an impossible mission - we got ridden with all kinds of bugs and crashes and in the end I said - go to hell MonoDevelop - I'll use my tried and true Emacs.
To tell you the truth with no features other than formatting and font locking Emacs turned out to be 10 times more productive environment for me. My friend somehow endured using MonoDevelop for the whole run of the project, but afterwards he said he was done with Linux for good if it offered such low quality dev tools.
Times were different back then, I've been following mono's development and monodevelop's as well - they seem to be turning out quite well. I think that the actual cause of your problem - not finding anything - lies in the fact that most Linux devs openly shun Mono as a development platform because of it's Microsoft roots. This is sad - because it's a solid alternative of Java - especially at the desktop applications front(GTK# is seriously cool).
Banshee seems to be using MonoDevelop. Probably most of the prominent mono projects with a GUI use it as well to some extent.
I've found MonoDevelop to be excellent so far. I've only been using it for about a month, but once I got it set-up the way I want it, I wouldn't go back to any other editor or IDE on Linux. It took me a while to figure out how to set the debugger up and configure the editor to how I like it.
It's almost like having Visual C# Express on Linux.
Try searching for MonoTouch projects. Mac + MonoDevelop + .NET iPhone apps.
I just tried compiling my project, 2 problems:
couldn't load Setup projects
couldn't load SQL Server Library projects
There is a way around this of course, just have to consider that not all project types can be built in mono and must design solution the way it doesn't stop you from building what you want.

How to get started with Mono in Linux for a beginner?

How do I start using Mono in Linux as a beginner when I want to switch from Visual Studio?
Is there some easy way to install it like Visual Studio and get started?
So far,with what I've seen,it looks complex to even get started.
Installing and configuring Mono in linux is a lot of work right?
or Is there some distro which I can directly install and get started with applications in Linux?
I recently started to dabble in Mono myself and have so far realized that the MonoProject has made huge advancements in this area. It's well worth it to investigate.
With that said, the easiest method is to get setup with a Linux distro that is Mono friendly such as Suse, or Ubuntu. Personally, I tried it using Ubuntu 8.10.
Once you've got your Linux distro setup properly download and install MonoDevelop. This is an open source IDE that's tightly integrated to work with the Mono platform. MonoDevelop was taken as a branch of SharpDevelop and designed to work with the Mono compiler from the ground up.
This is by far the easiest and fastest way to get setup with Mono. The MonoDevelop IDE is very similar to that of Visual C# Express even. It comes complete with Project/Solution management, GUI development using the GTK# framework, an integrated debugger and a host of other features you would expect in an IDE such as code-completion, line numbers, code-folding etc.
The folks at the MonoProject are on to something with this suite of tools.
Hope this helps you get started.
Mono Project Homepage
Mono Develop Homepage
There are a few interesting books on Mono, although they're probably a little bit old. Still, probably it's worth to grab one and take a look in order to start up.
Practical Mono
Mono: A developer's notebook
Cross-Platform .NET development
Mono Kick-start
Then, I'd install latest Mono (2.4) on a Linux box (OpenSuse is the one they use, so it will always go smoothly for development, but we also use Ubuntu internally) and start playing around with the compiler, MonoDevelop (which is quite good since 2.0) and so on.
The only tough point will be writing GUI applications, although my team make extensively use of MWF on different Unix flavors. But everything else will go as you'd expect. I'm specially happy with how great remoting works, for instance.
If you're used to Linux then it will be much easier, otherwise I'd also recommend you getting used to it following some tutorial.
Remember tools such us NUnit and NAnt will be also available, so you can start writing your code on both Windows and Linux and testing and compiling on both platforms.
With the just released Ubuntu 9.04 a very current Mono development environment is as close as:
apt-get install monodevelop
I used to agree with you that it was somewhat difficult to get going with Mono, but the latest version of Ubuntu has melted that barrier away. And the latest version of Monodevelop is an absolute joy to use.
Don't use Ubuntu? Then I would go with Peter's advice of using a VMWare image.
For a very easy start with mono under linux u can download
a vmware image
a linux live distro
with everything included to start.
If you are accustomed to using visual-studio, you can still develop in Visual Studio, and copy your binaries to Linux/OSX or whatever. Or even better, if you have a shared drive, just reconfigure your VS-Project output directory to the shared location.
There might be advantages to using the mono compiler, or monodevelop, but since you are getting started, the above is really the easiest thing to do. If you want to run on Linux, the mono installer is an excellent option for getting up and running in a hurry. Unfortunately, there's no installer available for the newest mono release, so you'll either need admin permission, or need to compile from source.
http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin
For installing newest Mono 3.2.5+ with MonoDevelop 4.2.1+ it is better is use tpokorra repository.
The simplest way I could find is to download the OpenSUSE VMWare Image on their site and just run it. You get all the tools you need :) Preconfigured.
Debian and Ubuntu, and probably all other children, have mono in the repository. So, setting up mono in Linux can be as easy as
aptitude install monodevelop
However I would suggest version 2 which requires using the 'sid' repository in Debian (don't know about Ubuntu).
vim /etc/apt/sources.list [ :%s/squeeze/sid/g ]

Categories

Resources