Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
122 views
in Technique[技术] by (71.8m points)

c# - Can you compile complicated WinForms apps on the .NET Core 3.0 with AOT / CoreRT?

I'm attempting to make a Windows forms application and compile it with CoreRT. When the app is simple, compilation works correctly; everything is compiled and the managed code is converted into natiive. However, if I do more than add a couple of buttons to the form, e.g. "Changing the icon", the application won't run when compiled? If anyone knows why, please let me know! Thanks.

The only code written was "MessageBox.Show(DateTime.Now.ToString(), "Current Date Time Native", MessageBoxButtons.OK, MessageBoxIcon.Information);" The problem I'm having is that the application compiles and runs only when basic controls are used. As soon as I add an icon to the application when I compile and try to run it, nothing happens. It doesn't even start.

The only thing I'm able to do in order to get the application to compile and run is add simple controls such as buttons and labels from the .NET toolbox. Adding something such as an Icon, or even changing the name results in the application compiling but when I try to run it, it doesn't start.

question from:https://stackoverflow.com/questions/65900556/can-you-compile-complicated-winforms-apps-on-the-net-core-3-0-with-aot-corert

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Short answer: no. Long answer, check https://github.com/dotnet/corert/issues/7995 for a list of partially working controls, most are missing as COM support is missing from CoreRT at present.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...