winforms visual styles on mono - c#

How to enable winforms visual styles in mono( probably running in fedora or ubuntu gnome) or is it a good idea to just use GTK#? The thing is I dont want to leave visual studio and use monodevelop for this. Thanks...

Winforms visual styles are more or less emulated in Mono but the appearance is not exactly the same as on Windows. It will work, tho.
I suggest you use GTK# if you plan running on linux indeed.

Related

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).

How do I get console application window in C#?

I am getting started on C# and installed Microsoft blend for visual studio and my newproject window looks like below.
I am looking for console application as shown in below screeshot,how do I get it?
EDIT1:
how do I launch visual studio IDE?
Use Visual Studio, not Blend, to create a new Console Application.
More info on Blend and it's uses.
Blend is an interface design tool and therefore can't be used to build console apps... Try Visual Studio Community instead.
Just going along with what everyone else is saying, Visual Studio 2015 COMMUNITY EDITION is free to download and fully featured. Great tool, if anything it has too many uses. I believe it may even have most of the Visual Basic features built in.
https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
From the Microsoft Blend Website:
Microsoft Expression Blend is a full-featured professional design tool for creating engaging and sophisticated user interfaces for Microsoft Windows
Which a console application is not; is has basically no UI. You should keep on using Visual Studio for console application.
You can likely make the console window appear in almost any application simply by using Console.WriteLine you can also create an arbitrary console by launching one:
Is there a way to create a second console to output to in .NET when writing a console application?
Legacy Services were default are not User Interactive and thus have no console easily viewable..

Blend for Visual Studio 2012 design view not working

I'm working on a Windows Store App in Visual Studio 2012 and decided it might be easier to start using blend for the interface and layout. But in my attempts to make this layout design easier for myself, I have run into a problem with the design view. The error message is that design view is unavailable for x64 and ARM platforms.
I'm familiar with this error from Visual Studio but I was just wondering if there's a simple way to change the target platforms so I can see the design view in Blend?
I know there have been problems with blend for VS 2012 up until now, but I thought maybe this was an easy one to fix that I'm missing somewhere.
If anyone knows a way to fix this I'd really appreciate it.
Thanks!
Close Blend
Open the project in Visual Studio 2012
Change Release/Debug Configuration to Any CPU or x86
Save All in Visual Studio to make sure it saves the project
(The Project does not save when you run!)
Reopen the document in Blend
That's it!
Just go to Build->Configuration Manager and change the Platform to 'Any CPU'.
Additionally you can enable the 'Solution Platform' dropdown in the toolbar by clicking the little down arrow right to the debugging Toolbar items then click 'Add remove buttons' and select 'Solution Platforms'.
Change .NetFramework from 4.5 to 4.0
You would need to install windows phone sdk for blend to work correctly in your application.
http://www.microsoft.com/en-us/download/details.aspx?id=35471

winform to GTK# for Mono

I have created a C# application with 50 forms.
Unfortunately Mono (Mac OS version) doesn't work with standard window winform.
I don't know why, but I this moment I need to solve the problem.
The only solution seem convert winform to GTK#, but I don't have any experience on GTK#.
My questions are:
How hard is convert my 50 forms to GTK# ?
What I need to do exactly ?
This is an easy solution ? Or I need to re-write my application ?
Apart this I don't know where I can found/use an Visual IDE to do a design modification like Visual Studio IDE.
GTK is a pretty good framework, on both windows and linux, GTK# is very easy to write by hand or to design using monodevelop. So it is worth a shot if you are curious, GTK# apps are generally easier to find help for ( the GTK+ docs are helpful )
The nicest thing about GTK# is the automatic layouts, no more crazy panel placement or absolute positioning like in winforms.
I am curious though why your winforms app isn't working, Mono's winforms support is pretty good and very near exactly matching .Net. What errors do you have?
The issue I had with Winforms at Mono was that in the files "xyz.designer.cs" there is often a code:
((System.ComponentModel.ISupportInitialize)(xyz)).BeginInit();
and
((System.ComponentModel.ISupportInitialize)(xyz)).EndInit();
looks like Mono does not accept this code.
My impression is that this code could be deleted from most of the windows forms. But I am not really sure.
For sure the "xyz.designer.cs" file cannot be modified under Visual studio since this code is automatically created by the GUI designer.
But you could modify these files under Monodevelop.
Looks like you would need to manually update 50 files.

Learn C# on mac?

Is mono the only route , any specific visual studio like editors that you recommend?
Without meaning to state the obvious and miss the point, if you mean a Mac computer rather than a Mac OS, you could install bootcamp or use parallels to run windows on the Mac and then use Visual Studio (there are also free versions of Visual Studio)
Yeah, mono is really your only option, unless some undergrad somewhere has developed some very experimental thing I don't know about. As for an IDE, well I believe the only thing half way stable that will work right now on Mac OS X is Monodevelop:
http://tirania.org/blog/archive/2008/Feb-07-2.html
I mean, you could run Parallels and develop your code on a Windows VM with Visual Studio and as long as you follow certain guidelines about portability, you could use VS to develop your mono apps. Although, you probably might as well get familiar with Monodevelop. It would be interesting to see if SharpDevelop ever gets ported.
Well, you could also try Silverlight...
Pro:
It is an official Microsoft implementation, so it is more likely to work
Its support for recent stuff like C# 3.0 is much better
Con:
It is browser-only, Silverlight apps do not run standalone
You won't get the whole .NET Class Library, only a subset, so it is somewhat limited
You won't get Visual Studio on a Mac
For IDE, I suggest Eclipse Tools for Microsoft Silverlight (apparently it is Windows-only at the moment) you should use MonoDevelop or SharpDevelop or something like that.
Use Xamarin Studio IDE.
https://xamarin.com/mac
Uses Mono and C#. It has any features you might expect from a modern IDE and combines with XCode for GUI.
Mono is pretty much your only route right now, though there are incessant rumours (I wouldn't give much thought to them, though) that Microsoft is planning to port C# to Mac in the future. I'd be very surprised if that happened, though.
As for IDEs, I can't help there... If I want C#, I stick to Visual Studio (run it through Parallels or BootCamp, if you really want to use VS).
Edit: As Graham points out, there is Cocoa#, but I'd caution that simply because the project has stalled, and there's unlikely to be much future for it. :(
I would go the virtualization route, either Parallels or VMware Fusion. Both will run Windows XP and Visual Studio very well on a modern Mac. Windows has the best tools for .NET and C# development and it only makes to use them, especially when you're just starting out.
Virtual Box is my new favorite and open source (means free) VM software. Don't pay for Parallels. Also, with BootCamp, you have to reboot the machine to switch between Windows and OS X, so Virtual Box is the way to go.

Categories