英文:
How to see the .NET MAUI sample application instead of home screen
问题
我刚刚开始使用.NET MAUI,并且已经遇到了一些问题。
不确定所有这些问题是否相关。
这是一台全新的机器,并且已经安装了Visual Studio。
我使用默认模板创建了一个新项目 - .NET MAUI App
-
当我运行项目时,它加载主屏幕而不是应用程序。我期望它加载带有计数按钮的.NET MAUI示例应用程序屏幕。
- 当我使用右上角的右侧图标栏中的
x
图标关闭模拟器时,它会关闭模拟器,但几秒钟后会再次打开。
- 当我第二次关闭模拟器时,它完全关闭,但显示错误,表示存在部署错误。
配置信息:
Visual Studio 2022 v17.6.2
模拟器:Pixel 5 - API 33 (Android 13.0 - API 33)
Windows 11 Pro
16 GB RAM
英文:
I'm just getting started with .NET MAUI and experiencing issues already.
Not sure if all of these issues are related.
This is a new machine and has a fresh installation of Visual Studio.
I Created a new project with the default template - .NET MAUI App
-
When I rebuild the solution, it takes more than 4 minutes. This seems too long for a single project. Is this expected or do I need more RAM.
-
When I run the project, it loads the home screen and not the application. I'm expecting it to load the .NET MAUI sample application screen with the counter button.
- When I close the simulator using the top right
x
icon in the right icons bar, it closes the simulator, but after a few seconds, it opens again.
- When I close the simulator the second time, it closes completely but shows an error saying there were deployment errors.
Configurations:
Visual Studio 2022 v17.6.2
Simulator: Pixel 5 - API 33 (Android 13.0 - API 33)
Windows 11 Pro
16 GB RAM
答案1
得分: 1
安卓模拟器在运行时,如果计算机上不支持硬件加速,速度会变得非常慢。
为了最大化安卓模拟器的性能,有以下虚拟化技术可用于加速安卓模拟器:
更多信息,请参考如何使用Android模拟器启用硬件加速(Hyper-V和AEHD)。
希望能起作用。
英文:
The Android emulator runs too slowly if hardware acceleration is not available on the computer that runs it.
In order to maximize Android Emulator performance, the following virtualization technologies are available for accelerating the Android emulator:
1.The Windows Hypervisor Platform (WHPX).
2.The Android Emulator hypervisor driver (AEHD).
For more info, please refer to How to enable hardware acceleration with Android emulators (Hyper-V & AEHD).
Hope it works.
答案2
得分: 1
可能的两种情景。
-
Android模拟器已启动并正在运行,但无法从Visual Studio连接(可能是模拟器/Visual Studio的错误)。
-
Android模拟器窗口已关闭,但其进程仍在运行,不允许启动新的Android模拟器实例。
我的解决方案:
- 打开任务管理器
- 转到“详细信息”选项卡
- 找到“emulator.exe”进程
- 鼠标右键单击该进程,然后选择“结束进程树”
之后尝试重新编译和部署应用程序。应该可以正常工作。
英文:
Two possible scenarios.
-
Android simulator is launched and is running, but it cannot be connected from Visual Studio (Simulator/Visual Studio bug probably).
-
Android simulator window is closed, but its processes are still running and do not allow to launch new Android simulator instance.
My solution:
- Open Task Manager
- Go to "Details tab"
- Find "emulator.exe" process
- Mouse right click on this process and select "End Process Tree"
After that try to compile and deploy your application again. It should work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论