[英]Running a .NET Core Console Application on Mac or Windows
Ive created a .net core console application. 我已经创建了一个.net核心控制台应用程序。 I want to build the app so that i can execute it on windows or mac without dotnet core is installed on the machine. 我想构建应用程序,以便我可以在Windows或Mac上执行它,而无需在网络上安装dotnet核心。 So i need eg for windows a exe. 所以我需要例如windows for exe。
Ive read https://docs.microsoft.com/de-de/dotnet/articles/core/tools/dotnet-publish and i know how to compile the application for the different plattform(s). 我已阅读https://docs.microsoft.com/de-de/dotnet/articles/core/tools/dotnet-publish ,我知道如何为不同的平台编译应用程序。
But no executable gets created. 但是没有创建可执行文件。 What i am missing here and how to accomplish my goal? 我在这里缺少什么以及如何实现我的目标?
What you need is to create a self-contained application . 您需要的是创建一个独立的应用程序 。 The link explains how exactly to modify your project.json to do that. 该链接解释了如何修改project.json来完成这项工作。
Also note that while a self-contained application does not have a dependency on .Net Core, it may have other dependencies. 另请注意,虽然自包含应用程序不依赖于.Net Core,但它可能还有其他依赖项。 Specifically on OSX, I believe you will need to install a specific version of openssl from homebrew. 特别是在OSX上,我相信您需要从自制软件安装特定版本的openssl。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.