Share via

Azure Pipeline Compiling Web API Framework Project Wrong

Palmer, Douglas@CDPH 0 Reputation points
2023-05-18T23:04:40.51+00:00

I have a Web API .NET 4.8 Framework project. It builds perfectly in Visual Studio. I am trying to build it in Azure Pipelines for automated deployment to application servers. The problem is that Azure Pipelines keeps building it incorrectly. Here is what I mean by that:

  • The \Bin folder is missing App_global.asax.dll and App_global.asax.compiled
  • The base folder has a global.asax file when it should not. The global.asax file only has one line in it declaring a global.asax.cs code behind file that does not exist.
  • The base folder is missing the PrecompiledApp.config file.

I have tried both VSBuild and MSBuild to try to build the project. The YAML Code is below.

Is there a build argument that I need to add or some other configuration?

variables:  
  buildPlatformSolution: 'Any CPU'
  buildPlatformProj: 'AnyCPU'
  buildConfiguration: 'Release'
  solution: "**/SolutionComplete.sln"  
  projectMarket: "MarketApi"  

- task: MSBuild@1
  inputs:
    solution: '$(projectMarket)/$(projectMarket).csproj'
    platform: '$(buildPlatformProj)'
    configuration: '$(buildConfiguration)'
    msbuildArguments: '/p:DocumentationFile="$(projectMarket).xml" /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:publishUrl=$(Build.ArtifactStagingDirectory)\$(projectMarket) /p:DeployIisAppPath="$(projectMarket)"'
    maximumCpuCount: true
    clean: true
	
- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatformSolution)'
    configuration: '$(buildConfiguration)'
    clean: true
Community Center | Not monitored

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.