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
Newsletter
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

  • Vapi vs Retell AI vs LiveKit: Architecture, Latency, Pricing, and Developer Experience
  • An Overview of Data Pipeline Architecture
  • Member Spotlight: Srinivas Chippagiri
  • Managing Technical Debt in AI-Generated Code

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  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
·
May. 06, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
6.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • 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