0

有沒有人有過使用TeamCity和Octopus構建.net核心應用程序的經驗?我知道有各種各樣的指南來實現這一點,但他們依靠有一個project.json文件已被微軟刪除。有沒有人想出任何解決方案?。用TeamCity構建.Net核心版

我目前使用的DOTNET - 核心插件通過TeamCity的建議 - 但它似乎依靠project.json文件

回答

0

你爲什麼不直接調用.NET CLI?我並不瞭解TeamCity或Octopus,但在Jenkins或AppVeyor中,我可以執行批處理或PowerShell腳本。我用它直接運行.NET CLI命令。 有了這個,你不依賴於任何預建的,但過時的加載項。

0

你可以使用FlubuCore。 Flubu是我們編寫的一個C#庫,用於構建項目並使用C#代碼執行部署腳本。

protected override void ConfigureTargets(ITaskContext context) 
    { 
     var compile = context 
      .CreateTarget("compile") 
      .SetDescription("Compiles the VS solution") 
      .AddCoreTask(x => x.ExecuteDotnetTask(StandardDotnetCommands.Restore).WithArguments("FlubuExample.sln")) 
      .AddCoreTask(x => x.Build("FlubuExample.sln")); 

     context 
      .CreateTarget("Package") 
      .CoreTaskExtensions() 
      .DotnetPublish("FlubuExample.sln"); 

     var test = context.CreateTarget("test") 
      .AddCoreTaskAsync(x => x.Test().WorkingFolder("FlubuExample.Tests")) 
      .AddCoreTaskAsync(x => x.Test().WorkingFolder("FlubuExample.Tests2")); 

     context.CreateTarget("Rebuild") 
      .SetAsDefault() 
      .DependsOn(compile, test); 
    } 

您可以找到有關flubu以及如何更多的信息,這裏介紹的flubu是如何在.NET的核心使用簡單的例子: choice-for-build-tool-msbuild-nant-or-something-else