问题描述
我有一个.NET Core控制台应用程序,并已运行 dotnet publish
。但是,我不知道如何从命令行运行该应用程序。有任何提示吗?
I have a .NET Core console app and have run dotnet publish
. However, I can't figure out how to run the application from the command line. Any hints?
推荐答案
如果它是依赖于框架的应用程序(默认),则通过运行它dotnet yourapp.dll
。
If it's a framework-dependent application (the default), you run it by dotnet yourapp.dll
.
如果它是一个独立的应用程序,则可以使用 yourapp.exe来运行它在Windows上为code>,在Unix上为
./ yourapp
。
If it's a self-contained application, you run it using yourapp.exe
on Windows and ./yourapp
on Unix.
有关两者之间差异的详细信息两种应用程序类型,请参见 .NET Docs上的文章。
For more information about the differences between the two app types, see the .NET Core Application Deployment article on .Net Docs.
这篇关于如何从命令行运行.NET Core控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!