在桌面应用程序上使用 .NET Core [英] Using .NET Core on Desktop Application

查看:35
本文介绍了在桌面应用程序上使用 .NET Core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用 C# 开发服务器,我想使用 .NET Core,因为据说它是多平台的,我可能有兴趣在 Linux 上运行它.

I am starting the development of a server using C# and I would like to use .NET Core as it is said multi-platform and that I might be interested on running it on Linux.

我用 DNX 安装了 CoreCLR,正如这里所说:http://dotnet.readthedocs.org/en/latest/getting-started/installing-core-windows.html

I installed the CoreCLR with DNX as it is said here: http://dotnet.readthedocs.org/en/latest/getting-started/installing-core-windows.html

但是我想直接从 Visual Studio 定位到 .NET Core,我没有任何选择.

However I would like to target the .NET Core directly from Visual Studio, I don't have any option to do so.

我正在编写一个经典的桌面控制台应用程序,而不是 ASP.NET 应用程序,但是 .NET Foundation 的 GitHub 上的一些示例基于控制台应用程序,所以我想这不是问题

I'm coding a classic desktop console application, not an ASP.NET one, but some examples on the GitHub of the .NET Foundation are based on console application so I guess it's not a problem

是否有人设法安装和定位 .NET Core,如果是,如何安装?提前致谢

Have someone managed to install and target the .NET Core, and if so, how ? Thanks in advance

推荐答案

为此,您需要在 VS 2015 中执行以下操作:文件->新建项目->(Visual C#)->Web->控制台应用程序.我猜你在Windows"下创建了一个控制台应用程序.它运行在经典的 CLR(不是 CoreCLR)之上

For that you need to do the following in VS 2015: File->New Project->(Visual C#)->Web->Console Application. I guess you created a console application under "Windows". It runs on top of the classic CLR (Not CoreCLR)

另外,如果您想在调试时确保应用程序在 CoreCLR 之上运行,请右键单击项目 -> 属性 -> 应用程序选项卡 -> 并在平台"下选择.NET Core"(仅适用于在Web"->控制台应用程序"下创建的项目)

Plus if you want to make sure that the application runs on top of the CoreCLR when you debug it then right click to the project -> Properties -> Application Tab -> and under "Platform" select ".NET Core" (only works for projects created under "Web" -> "Console Application")

这篇关于在桌面应用程序上使用 .NET Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆