c# - Cosmos 基本示例无法运行
问题描述
我正在尝试使用 C# 开始使用 Cosmos。我安装了 Visual Studio 2017 和 Cosmos 用户工具包。在 youtube 上的许多教程中,我看到 VMWare 播放器在按下“运行”按钮时就会启动。
但是,就我而言,我收到以下错误:“无法直接启动具有输出类型的类库的项目。”
我的代码真的很简单,是文档中给出的基本示例。请帮我解决这个问题。
using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
namespace CosmosKernel2
{
public class Kernel : Sys.Kernel
{
protected override void BeforeRun()
{
Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back.");
}
protected override void Run()
{
Console.Write("Input: ");
var input = Console.ReadLine();
Console.Write("Text typed: ");
Console.WriteLine(input);
}
}
}
解决方案
Cosmos 是一个内核。您不能“在 Windows 上运行内核”。如果你想直接从 Visual Studio 运行你的 cosmos 内核,你需要一个虚拟机。
Cosmos 使用开箱即用的 Vmware。确保已安装它。或者你可以使用 VirtualBox,我个人也让它在上面运行。
您还可以在带有引导加载程序的实际机器上运行它,例如 Grub。您可以通过这种方式双重引导到 Windows 或您自己的内核。
Cosmos 在这里有说明:https ://github.com/CosmosOS/Cosmos/wiki/Deployment
将 cosmos 生成的 boot 设置为启动项目来运行它。
推荐阅读
- ios - CIDetectorTypeQRCode 无法扫描透明图片
- javascript - Puppeteer 在屏幕截图导致片状视觉差异测试之前调整大小
- javascript - 使用 Opencv.js 在 javascript 中的图像上画一条线
- javascript - Testcafe 客户端功能失败“ClientFunction 代码中发生错误:ReferenceError:_from2 未定义”
- http - # 分隔符是否总是引入 URI 的片段部分?
- netty - ReplayingDecoder 想要收集多个传入消息并将它们传递给下一个处理程序
- c# - 如何从客户端断开 SignalR 以实现超时功能
- c# - ASP.NET 循环遍历一次获得 28 个数组
- mysql - MySQL如何选择group by中的第一个非空值
- asp.net - 使用服务标识时无法连接到 Azure Key Vault