简体   繁体   English

C# 中的“System.Object”错误是否有修复?

[英]Is there a fix for the 'System.Object' error in C#?

I have a Macbook Pro and I am emulating Win10 with VirtualBox to run Visual Code and it keeps giving me multiple errors like "predefined type 'System.Object' is not defined or imported".我有一台 Macbook Pro,我正在用 VirtualBox 模拟 Win10 来运行 Visual Code,它不断给我多个错误,例如“未定义或导入预定义类型 'System.Object'”。 It gives me the same errors with 'System.String' and 'System.Void', and when I run the application is giving me multiple build errors regarding this missing libraries.它给了我与“System.String”和“System.Void”相同的错误,当我运行应用程序时,给我关于这个缺少的库的多个构建错误。 I already tried to check if all the components for Visual Code are correctly installed and I already have the .NET Core cross-platform development tools but I was not able to resolve the issue.我已经尝试检查是否正确安装了 Visual Code 的所有组件,并且我已经拥有 .NET Core 跨平台开发工具,但我无法解决问题。 Is there any workaround to have this working properly?有什么解决方法可以正常工作吗?

After making some tests, I believe the problem was given by using VirtualBox as a vm software.经过一些测试,我相信问题是使用VirtualBox作为vm软件给出的。 I was not able to find a workaround and still use VB as main vm.我找不到解决方法,仍然使用 VB 作为主虚拟机。 I installed Parallels and I didn't find any error on my code.我安装了 Parallels,但我的代码没有发现任何错误。 This is helpful in case you want to work with Windows Forms Applications in Visual Studio using a MacOS computer.如果您想使用 MacOS 计算机在 Visual Studio 中使用 Windows Forms 应用程序,这将很有帮助。 This option is not available in the MacOS version of VS, so if the purpose is to use WFA, you can either use virtualization through Parallels Desktop or installing Mono in your VS for Mac, as I read on other posts regarding this issue.此选项在 VS 的 MacOS 版本中不可用,因此如果目的是使用 WFA,您可以通过 Parallels Desktop 使用虚拟化或在您的 VS for Mac 中安装 Mono,正如我在其他有关此问题的帖子中阅读的那样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM