C#winform software realizes one-time compilation, is compatible with cross-platform windows, linux, and mac, and is compatible with Visual Studio native interface Form form development.

C#winform software implements one-time compilation, is compatible with cross-platform windows, linux, and mac, and is compatible with Visual Studio native interface Form form development 1. Background: Microsoft’s .net core development tool, currently, the winform interface software is not intended to support running on the Linux system. If you want C# desktop software to run on the Linux system, it is still troublesome to develop. Microsoft only allows C# console software to run on Linux. 2. Solution: One solution I thought of was to customize the System.Windows.Forms component that encapsulates the software, and encapsulate the interface framework GTK that supports windows and Linux into System.Windows.Forms! This plan has two characteristics: 1. Compatible with native C# form controls, the original C# software does not need to be redeveloped, just replace it with this component and recompile 2. You can use Visual Studio for visual development. There is no need to learn the framework, just reference the DLL 3. Component packaging This System.Windows.Forms is the key component to implement the C# interface. All controls of the Form interface are encapsulated in this component. In the .net core environment, this component is under the framework Microsoft.WindowsDesktop.App.WindownsForms. When the output mode of the development project…

Cross-compilation under GolangLinux, Windows, and Mac

Golang supports cross-compilation, that is, the same code is generated on one platform and can then be executed on another platform. I have written an article before about Golang cross-compilation under windows. I feel that the article is not comprehensive enough, so this article is a supplement. Cross-compilation Compiling on Mac # Generate compiled files and run them in Linux CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go # Generate compiled files and run them in Windows CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go Compiling on Linux # Generate compiled files and run them on Mac CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go # Generate compiled files and run them in Windows CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go Compiling on Windows terminal in Windows does not support shell, which is the same as Mac and Linux > It’s a little different. At this time, you can write a batch program and set it in it # Set up Mac compilation environment SET CGO_ENABLED=0 SETGOOS=darwin SET GOARCH=amd64 go build main.go # Set up Linux compilation environment SET CGO_ENABLED=0 SETGOOS=linux SET GOARCH=amd64 go build main.go Parameter description CGO_ENABLED: CGO represents the tool in golang, CGO_ENABLED represents that CGO is disabled, and CGO cannot be used in…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索