DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Deploying a Simple Golang Web App on Heroku
  • Feature Flags and Safe Rollouts With Azure App Configuration for Large SPA Teams
  • Expert Techniques to Trim Your Docker Images and Speed Up Build Times
  • DevOps Remediation Architecture for Azure CDN From Edgio

Trending

  • Stateless JWT Auth Microservice Architecture With Spring Boot 3 and Redis Sentinel
  • How to Format Articles for DZone
  • How to Write for DZone Publications: Trend Reports and Refcards
  • Building a Zero-Cost Approval Workflow With AWS Lambda Durable Functions
  1. DZone
  2. Coding
  3. Languages
  4. Error Publishing .NET Core App in Azure DevOps YAML Build

Error Publishing .NET Core App in Azure DevOps YAML Build

A dev quickly walks us through an error he received when working in .NET Core and how he fixed it with a little YAML.

By 
Ricci Gian Maria user avatar
Ricci Gian Maria
·
May. 06, 19 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
6.2K Views

Join the DZone community and get the full member experience.

Join For Free

short story, i've created a simple yaml build for a .net core project where one of the tasks publishes a simple .net core console application. after running the build i got a strange error in the output:

no web project was found in the repository. web projects are identified by presence of either a web.config file or wwwroot folder in the directory.

this is extremely strange, because the project is not a web project, it is a standard console application written for .net core 2.2, so i do not understand why it is searching a web.config file.

then i decided to create a standard non-yaml build, and when i dropped the task on the build i immediately understood the problem . this happens because .net core task with the publish command is assuming, by default, that a web application is going to be published.

default value for the dotnet publish command figure 1: default value for the dotnet publish command is to publish a web project.

since i hae no web project to publish i immediately changed  my yaml definition to explicitly set the publishwebprojects property to false.

 - task: dotnetcorecli@2
    displayname: .net core publish
    inputs:
      command: publish
      projects: '$(serviceproject)'
      arguments: '--output $(build.artifactstagingdirectory)'
      configuration: $(buildconfiguration)
      workingdirectory: $(serviceprojectdir)
      publishwebprojects: false
      zipafterpublish: true

and the build was fixed.

Build (game engine) YAML .NET Web application app DevOps azure

Published at DZone with permission of Ricci Gian Maria. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Deploying a Simple Golang Web App on Heroku
  • Feature Flags and Safe Rollouts With Azure App Configuration for Large SPA Teams
  • Expert Techniques to Trim Your Docker Images and Speed Up Build Times
  • DevOps Remediation Architecture for Azure CDN From Edgio

Partner Resources

Ă—

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook