Find the Mono version on Visual Studio - c#

When trying to connect to Mac on Visual Studio on Windows, I'm told that the version on the Mac is different and am asked by VS if I want it to install Mono on the Mac.
But the version on the Mac is newer.
From experience, I've seen that trying to do that created more trouble rather than help.
So I'd like to search for how to update the Mono version on Windows/VS, but I can't seem to find anywhere an option to do that. So I want to find out what version is "installed" on VS.

If you're going to be working predominantly on a windows machine, then let it install whatever version the visual studio wants. Sometimes windows visual studio will use a different version than mac visual studio. The environment you're working in should dictate what version you use.

Related

Smart Device development for Visual Studio 2017

I am currently assigned to migrate an existing Smart Device application built using visual studio 2005. I tried to migrate the application to Visual Studio 2017 without changing the framework and settings. I have already spent some time doing some research but no luck so far.
This is the error I'm encountering:
Any leads or advice is appreciated.
I guess you are talking Windows Mobile 6.x projects. Unfortunately,
support for mobile application development for versions of Windows Phone prior to Windows Phone 7.0
has been dropped with Visual Studio 2010.
The last version that supported this application type is Visual Studio 2008. Usually, you can install different versions of Visual Studio without problems. Nonetheless, this is a very old version and it might be worth to keep it on a separate machine.
You are stuck with Visual Studio 2005 or use VS2008. That's it.

C# Interactive in Visual Studio Community on Mac

I'm trying to do some treehouse tutorials on C#. Unfortunately, the instructor is teaching this course in an windows machine with a windows version of VS Community while I follow along VS Community for mac. Got to a point where she is trying to use the C# interactive (REPL) but I can't seem to find it on the mac version. Anyone know if its even possible to do this on the mac? Thanks.
You can't run it in Visual Studio. You can, however, use the terminal.
When you install mono the command csharp gets installed as well.
Simply type csharp and the terminal will become a C# interactive window.
If you have Mono installed you can also use: csi
No Interactive Window support in VS 2017 Mac.
Future versions may have this feature. If it is important you could use Parallels and run the Windows version.
Or work around it by doing the same sorts of things with a debugger and Immediate Window.
Use Xamarin Workbooks!
If you don't like Xamarin Workbooks for whatever reason, you can also use csi in the console, but it doesn't have code completions :/ I couldn't edit Sachin's answer above, but to be more clear, all you need to do is open the terminal and type csi to start the C# interactive tool. Of course this only works after you've installed Visual Studio (it should have installed Mono in the process).

Visual Studio, MonoGame integration issue

I installed monogame from there site, the 3.4 version for Visual Studio as it's the version specified for a course I'm taking. I already had the most recent version of Visual Studio 2015 community edition installed for use with unity. Something potentially important to note is that VS is installed on my (f) hardrive where as monogame autamtically installs onto the (C) boot drive where my windows is, I also installed windows SDK there. I don't have enough space on the boot drive for VS and Unity.
The install seemed to go fine, but no monogame templates show up within Visual studio itself when I try and crate a new project. I found them in the directory in documents, so they did install,(F:\Documents\Visual Studio 2015\Templates\ProjectTemplates\Visual C#\MonoGame) and nothing in itemtemplates, though copying it over to item templates didn't do anything. So, for some reason they aren't showing up in Visual Studio and they really need to in order to have any use.
Anyone have suggestions/solutions? I've reinstalled monogame multiple times and am very reluctant to reinstall VS.
I tried a number of things, including suggested solutions on these forums and nothing seemed to have any effect as nothing would appear under templates within VS. I finally just installed MonoGame 3.5 and it worked fine immediately... I've been doing the course with 3.5 and have ran into no problems so far, but admittedly I haven't gotten to the part which makes use of MonoGame yet....

Can I program in C# on a Mac?

I want to learn C# for Unity and my personal computer is a MacBook Air. Can I program in C# on a Mac?
Your first option is Microsoft Visual Studio for Mac which was released in 2017. If you're used to VS ide then I suggested you download this.
If not then you can have a look into MonoDevelop. You can download from here
MRE = Mono Runtime Environment
MDK = Mono Development Kit.
MDK = MRE + Extra tools, libraries, .NET PCL (Portable Class Library) profiles, etc.
If you have an application that you want to run that needs Mono you can install just the MRE.
If you are doing development, writing C# applications, whilst you can sometimes get away with just having the MRE installed, you may hit some missing features such as not having the .NET PCL profiles. So I would install the MDK if you are doing development. Reference
Yes, it is. Microsoft has released Visual Studio Code 2017. It works on Windows, Mac OS, and Linux; It is quite nice development text-editor. It works similar to the full-version, available on Windows - with a few draw-backs, and it will allow to write programs, as well as run and test them right on your Mac.
Microsoft Docs offer a quick getting started tutorial and a Hello World program out-of-the-box with the Visual Studio Code.
You will need to install a few dependencies, however. Which may sound kinda of obvious:
Visual Studio Code
.Net Core SDK
C# extension from the marketplace.
I had good luck getting started and Visual Studio got all of the dependencies for me; so I simply went into the program, opened the integrated terminal (View > Integrated Terminal) and ran the command dotnet new console, and boom, a few seconds later I had a Hello World program, written in C#, running on my MacBook Pro.
There is now a Visual Studio for Mac available as a free community version as well as professional and enterprise versions by subscription.
JetBrains also has an IDE for C#, called Rider, that runs on the Mac. If you use IntelliJ or any of their other products you might like it - it feels better to me than MonoDevelop or Visual Studio for Mac. It is a commercial product but JetBrains offers very generous license terms (as in free) for students and open source projects. They also have a substantial discount for startups.
It is possible, but you won't be able to use Microsoft's tools, you'll need to use a third-party program like Xamarin Studio (MonoDevelop).
Edit
at the time of this answer there wasn't a Microsoft tool/IDE that could be used for developing .net / C# programs on a Mac. Now there are two:
Visual Studio Code
Visual Studio for Mac
Note that while everyone mentions Mono and Xamarin, which you should absolutely look into for C# development, Unity works on Mac directly, specifically Mac OSX 10.6+
while both use the C# language, some of the paradigms espoused by Unity are a little different from standard C# development. I personally recommend learning both.
ADDENDUM: Note that MS has recently announced that they'll be moving the standard .NET implementation cross-platform, and are doing so with the help of the Mono team, so while there's currently a confusing dual set of tools, it'll be shifting away from this in the future
It is entirely possible, if you install a version of Windows using Bootcamp you can switch between the two at start up and have the full functionality of both by installing Visual Studio on the Windows partition. Alternatively, you could use VMware such as Virtual Box and use Windows within your Mac OS.

Using visual studio for developing mono applications

How do I use Visual Studio to develop applications on Mono? Is this possible?
You just build the applications in Visual Studio, and run them under Mono instead of under .NET. The binaries should be compatible... but you'll need to make sure you don't use any libraries which aren't available in Mono - see the Mono Application Compatibility Guidelines.
(According to that page, you need to turn off incremental builds in Visual Studio though - a point I wasn't aware of before :)
See this article on how to run your apps while targeting the mono framework from VS.
Miguel has posted this entry a while ago, so it's quite dated. You can also try this and this (all hail Web Archive!)
Since version 2.0 MonoDevelop supports VisualStudio project/solutions file format. This means that you can use the same code base on Windows with VS and .Net and on Linux with MonoDevelop and Mono. That in my opinion is the best way to go about it. There are no major reasons to run application in Mono on Windows, other than for testing purposes and for that I'd rather set up a virtual machine to test the software in native environment.
I've posted an article on how to integrate Mono 2.8 (the build for .Net 4.0) into Visual Studio 2010 here - there's a link there to another profile built for Mono 2.4 (.Net 3.5) if that's what you're aiming for.
You can integrate the new Mono 2.8 profile with 3 simple steps:
Download the profile itself from here.
Unzip the contents of the profile Zip to one of the following directories:
32-bit systems: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile
64-bit systems: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile
The "Mono" folder in the ZIP should be directly under the "Profile" directory.
Restart Visual Studio if it had been running, open the properties of the project you want to use with Mono, and select the Mono Profile for 2.8:
Note: You will not be able to select the Mono Profile straight from the New Project dialog box; for some reason, that list of profiles doesn't match. Create your project as a .Net Framework 4.0 project first, and after creation set the project properties to Mono.
If you've upgraded your MonoDevelop install to the latest version (as of today, anyway), this Visual Studio solution & Project file will open with no problem - no changes required at all.
If you encounter the problem that you need .NETFramework,Version=v4.0,Profile=Mono in order to run the application, the trick was to create registry key.
For running Windows 7 x64, it was: HKEY\_LOCAL\_MACHINESOFTWAREWow6432NodeMicrosoft .NETFrameworkv4.0.30319SKUs .NETFramework,Version=v4.0,Profile=Mono
I suppose for x86 it’s HKEY\_LOCAL\_MACHINESOFTWAREMicrosoft.NETFramework v4.0.30319SKUs.NETFramework,Version=v4.0,Profile=Mono
(Where v4.0.30319 would be the version of the current 4.0 framework installed.)
Yes, you can develop on Visual Studio and target Mono (Mono for x86).
Here is an answer I made on all the available possible alternative to compile against Mono on Windows. However, it's focused for Mono x86.
As a summary, let's list the possible choice for VS development:
MonoHelper addin
Mono Profile
For Android/Ios, you can also cross-compile and debug inside Visual Studio with Xamarin addin. Although it's not free for commercial huge applications, there a free version available to make small ones.
Note: For those who wonder why in the world I would like to develop in Visual Studio on Windows, instead of MonoDevelop on Unix, let say that developer experience in MonoDevelop does not compare to VS one (especially when it comes to debugger/refactoring, the last due more to Resharper than to VS itself).

Categories