Publish simple Asp.Net Core App (.Net Framework) with WebJob

前端 未结 4 399
萌比男神i
萌比男神i 2020-12-10 08:14

I would like to create a simple ASP.NET Core Web Application (.NET Framework) and publish a WebJob alongside it to Azure.

I\'m using Visual Studio 2017, but the resu

4条回答
  •  囚心锁ツ
    2020-12-10 08:41

    I managed to get it works in all cases to publish VS 2017 csproj using VSTS or locally with these lines:

    
      
        
        $(PublishDir)\
      
    
      
        $([System.IO.Path]::GetFullPath('$(PublishDir)'))
      
    
    
    
      
    
    

    It ensures:

    • PublishDir has a trailing slash (could miss when using dotnet publish -o option).
    • We are using the full path (unlike previous versions, using dotnet publish [project] now change the current directory, so with a relative path like the default /bin/[configuration]/[framework]/publish the WebJob would be published in its own bin folder instead of the Web project's one).
    • We are using the same publish configuration (RuntimeIdentifier, TargetFramework, Configuration) than the Web project's one.

    Hope that helps!

提交回复
热议问题