Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Deploy to Azure DevOps #5725


User avatar
0
ProjectIridium created

Hi, is there any guidance around about setting up a project in Azure DevOps? The setup below is what I'm trying, however …

<span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)">The Nuget Restore task fails for me with "Application.Shared is not compatible with</span></span> netcoreapp2.1". <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)"> </span></span> <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)">Should I be using</span></span> the "dotnet build" tasks instead of the Nuget Restore? <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)"> </span></span> <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)">If I try to skip the</span></span> Nuget Restore and go straight to Build Solution, I get errors about missing packages.

<span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)">Thanks</span></span> for any help, this is going to be so very cool once I get this going. <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(0, 0, 0)">--Andy</span></span>

<br>


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ProjectIridium

    Application.Shared project targets netstandard2.0 and "dotnet build" cannot the whole solution because of this (Visual Sudio can).

    You can try to build projects targeting netstandard first and then, you can build other projects. This approach worked for me.

  • User Avatar
    0
    ProjectIridium created

    Thanks, I'll give that a try. Would anyone mind sharing their YAML build file? I'll post mine once I get it working.

  • User Avatar
    0
    ProjectIridium created

    I finally got a version of this that works, I didn't use any of the built-in tasks above, I used a .yml file directly. The hardest part was getting the bundled files to work. Hope this helps someone. --Andy

    azure-pipelines.yml

    # AspNetZero pipeline # Andy Weston - 10/5/2018 # pool: vmImage: 'VS2017-Win2016' demands: npm steps: - task: DotNetCoreInstaller@0 displayName: Use .NET Core sdk inputs: version: 2.1.402 - powershell: .\build\build-publish.ps1 $(Build.DefinitionName) $(Build.ArtifactStagingDirectory) - task: PublishBuildArtifacts@1

    <span class="colour" style="color:rgb(0, 0, 0)"><span class="colour" style="color:rgb(24, 24, 24)"><span class="colour" style="color:rgb(24, 24, 24)"><span class="colour" style="color:rgb(24, 24, 24)">build-publish.ps1</span></span></span></span>

    param($buildConfiguration, $artifactStagingDirectory) cd ./src/Iridium.Operations.Web.Mvc npm install gulp yarn npm run create-bundles dotnet publish -f netcoreapp2.1 -c $buildConfiguration -o $artifactStagingDirectory cd ../Iridium.Operations.Migrator dotnet publish -f netcoreapp2.1 -c $buildConfiguration -o $artifactStagingDirectory\migrator cd ../..

  • User Avatar
    0
    ismcagdas created
    Support Team

    @ProjectIridium thanks :)

  • User Avatar
    0
    ncvitanovic created

    @ProjectIridium Where did you add custom yml file and build-publish?

  • User Avatar
    0
    MarxItSolutions created

    @ProjectIridium Did you get your project up on Devops? If so, how?