Windows Form .net

0 views
Skip to first unread message

Hadi Sapre

unread,
Aug 4, 2024, 3:47:25 PM8/4/24
to atsereve
Myquestion is, is there any simple way to be able to code windows form app on a mac book. So far i have not been able to find a way to do this. Is there a way or do i have to save up and buy a laptop and run Windows on it.

There's no way to develop for Windows Forms on a platform other that Windows itself. You might use other tech stacks or cross platform toolkits like GTK+ or Eto which can translate the designer code and create Windows Forms applications, but native Windows Forms development is not available due to a huge count of Windows-exclusive PInvokes. No chance here.


However, you don't need to have a Windows laptop to code on a mac - you always have the option to use virtualized desktops where the Windows system runs as a so called "image". Some are free and just require you to put in a Windows installation disk (or disk image) - so you run the installation in that virtualized system and can boot it shutdown it whenever you like. It is literally like having a computer in a computer. There are a lot of virtualization tools like VMWare Player or Oracles VirtualBox. On Mac, Parallels Desktop is very popular. It can integrate virtualized Windows applications to MacOS without having that virtualized image as "box" you connect to. The virtualized windows integrate quite seamlessly into the Mac desktop and support window management commands like App Expos and Mission Control.


Another great options is to create an account on Microsoft Azure where you can rent virtual Windows systems online to a very low price. The benefit is, that those systems run in the clould and can be accessed from everywhere you'll ever go (as long as you have an internet connection).


Developers use the .NET Framework to create Windows desktop applications and server based applications. This includes ASP.NET web applications. .NET is used to create applications that could run on Windows, Linux and Mac. It does not support creating Windows desktop applications on platforms other than Windows. Developers can write applications and libraries in VB.NET, C# and F# in both runtimes.


What does .NET has the .NET Framework doesn't? .NET will receive new features and runtime improvements. It has better performance, and it has ability to have different versions of .NET deployed side-by-side on the same machine, create self-contained applications, and be completely independent on the environment you are running on and so on


What does the .NET Framework has the .NET doesn't? It has some older API that will not be moved to .NET. And how do you choose for your new applications choose .NET for your applications that are only in maintenance mode and all the development is completed you don't want to touch that code it's completely safe to leave them on the .NET Framework and for existing applications that are targeting .NET Framework but are in active development you can make your call if they move them to .NET or leave them on the Framework you can evaluate benefits and porting cost and make the decision that is best for your application


When you create a new project and you can see a (.Net Framework) which means it only works under Windows OS and creates applications only for windows. The other default template I believe is for .Net Core a cross-platform which runs in different OS.


Last year we open sourced WinForms and brought it to .NET Core. Now it is available in .NET 5 preview and reviewing new features (like Task Dialog) and lots of PRs from the ole source community. You can check out the repo and the roadmap here:


Thank you for your hard work!!

If you can provide a few examples of creating and running WinForm/WPF programs, or if a link exists, please leave me a comment.I will study hard.We are currently using a third-party Devexpress vendor and are considering cross-platform support.

Thanks again.


Basically the reason is to bring the benefits that .NET Core has to the broader Windows Forms community which has a lot of developers, specially in developing countries. Besides that, Microsoft already open sourced Windows Forms and WPF (Windows Presentation Foundation) libraries.


Windows Forms still has lots of users and with supporting it in .NET Core and .NET 5 we are making sure those users can benefit from from all the performance improvements and new features. This platform is fully supported and will receive all the updates in the future.


Windows Forms + .NET Core allows you to ship your UI framework with your application, independently of the version of the framework installed with Windows. This puts it in line with Qt, Swing, and most other GUI frameworks.


The independence helps avoid problems like this one, whereby upgrading a system from .NET 4.0 to 4.5 introduced problems with almost any app that uses a menu MenuStrip, due to bugs in 4.5. Some hard lessons were learned by the team in that 4.5-4.6 time period and Microsoft had to start building .NET Framework in such a way that any new behaviours (including bug fixes!) would need to be opted into on a per-application basis. But that has proven to have its limits, too, because third-party libraries have to understand all the potential variances in behaviour, too.


We have a bunch of forms that inherit from a common base class like FormBaseTViewModel. For us the FormBaseTViewModel does a lot of heavy-lifting and it is essential to our existing infrastructure. But the WinForms designer crashes for inherited types. Eg. cant open the designer of Foo where `Foo : FormBaseFooViewModel`. There are certain hackish workarounds available on the internet but they all work only maybe at best 50% of the times.


Yes! We will definitely support it, this is our next item on the roadmap after completing third-party controls and data binding scenarios! Sorry for your struggle now, we are working hard on getting it all done!


With the preview released today Visual Basic designer support is completely broken for core projects (null reference Dialog if you try to open any form in designer). They do work in release version at least for supported controls.


Note that you will also reset UI customizations (theme, position of windows, code styles, etc), which is a pain. But seeing as how that Button control is kind of important, I guess it just has to be borne.


Hi; When i double-click on the form in the Solution Explorer i have this warnig message : The object reference is not defined to an instance of an object.

please what to do to resove this probleme.


So I had the same problem and yes you can't find .NET core windows form directly to open windows form that support windows form you will need to first open non .NET framework windows from app there you can select if you want core which version.Windows Form Application


I'm migrating an existing windows forms C# app to .NET 5.0 and I'm trying to follow the instrutions presented on the migration docs. Everything is working ok, but there's still one thing to do: migrate the debug/release settings from app.config files.


I've thought about reusing NET Core's IConfiguration, but adding the Microsoft.Extensions.Configuration nuget package to the project (so that I'm able to create a ConfigurationBuilder instance) seems to break everything (for instance, using System; will start generating compile errors).


It looks like you are familiar with application/user settings in .NET 4.x. The same is still supported in .NET 5. Settings.settings file is part of the default project template and it allows you to create user settings and application settings with designer support and many more features. You can look at Application Settings for Windows Forms.


Windows Forms (and WPF) are both not supported on Linux with .NET Core and probably never will be. Winforms runs on mono, but that is based on .NET Framework, not .NET Core. The reason is mostly because the internal implementation of Windows Forms is actually an abstraction layer over the Windows GDI, and therefore a linux port would need to be a complete rewrite.


.NET 6.0 will bring a new GUI framework called maui, which is intended to bring real cross-platform experience to .NET. This is hopefully the last step to make .NET really cross platform, as it was actually designed 20 years ago. You can already try it out, as prerelease versions of .NET 6.0 are ready for download (go to -download).


You can develop WinForms and WPF UI applications using .Net Core. But these UI applications can run only on Windows. Only non-UI applications developed in .net core is truly cross-platform and can run on Windows, Linux and Mac OS.


I am trying to config a elastic agent in a windows desktop application(winforms) in the .NET framework 4.8. My goal is to change the Agents Url and Service name, without having to use environment variables. I tried using Agent.Setup with Agent Components and putting the config details in app.config file in the , but no success. The Agent seems to ignore the app.config file and use the default values.


Does anyone know a way I could modify the Agents config without having to use the app or environmental variables. and also I was wondering if there was any resources on how to config an Agent in windows desktop application in .NET framework 4.8?


One of the features of the INamedCache interface is the ability to add cache listeners that receive events emitted by a cache as its contents change. These events are sent from the server and dispatched to registered listeners by a background thread.


The .NET Single-Threaded Apartment model prohibits windows form controls created by one thread from being updated by another thread. If one or more controls should be updated as a result of an event notification, you must ensure that any event handling code that needs to run as a response to a cache event is executed on the UI thread. The WindowsFormsCacheListener helper class allows end users to ignore this fact and to handle Coherence cache events (which are always raised by a background thread) as if they were raised by the UI thread. This class will ensure that the call is properly marshalled and executed on the UI thread.

3a8082e126
Reply all
Reply to author
Forward
0 new messages