我想運行和調試 .Net Core (2.2) 控制臺應用程序(不是 ASP.Net Core?。?。因此,我創建了一個非常簡單的應用程序:public static class Program{ public static void Main(string[] args) { WriteLine("**Environment**"); WriteLine($"Platform: .NET Core"); WriteLine($"OS: {RuntimeInformation.OSDescription}"); WriteLine(); ReadLine(); } private static (string, bool) ParseArgs(string[] args) { var buffer = new StringBuilder(); var withColor = false; foreach (var s in args) { if (s == "--with-color") { withColor = true; continue; } buffer.Append(" "); buffer.Append(s); } return (buffer.ToString(), withColor); }}添加了 Docker 文件。添加了Microsoft.VisualStudio.Azure.Containers.Tools.TargetsNuGet 包。最后修改為launchSettings.json:{ "profiles": { "dotnetapp": { "commandName": "Project" }, "Docker": { "commandName": "Docker" } }}因此,一切看起來都像在帶有 Docker 支持的默認 ASP.Net Core WebApp 中。但在“運行”時,我只收到錯誤“無法使用此應用程序執行配置文件‘Docker’”。我不明白,有什么區別?如何像 .Net Core ASP 應用程序一樣運行簡單的 .Net Core 應用程序?
1 回答

暮色呼如
TA貢獻1853條經驗 獲得超9個贊
似乎沒有答案,但它似乎適用于 Visual Studio 2019 中的 Steffen(和我自己)。也許 Visual Studio 2017 工具中存在錯誤......
- 1 回答
- 0 關注
- 125 瀏覽
添加回答
舉報
0/150
提交
取消