0
votes

I have aspnet MVC 5 solution which is containing several project, i need to publish the main project using azure CI and CD so i configured azure build pipeline (see the attachment for configuration). but when the artifacts are generated i noticed that there is no bin folder with deployment files. what could be the possible reasons for this behavior?

This is the generated artifact

This is Solution Configuration task

This is the publish path

This is publish artifact configuration task

This is link for the logs of the pipeline

This is The error when i chose the solution instead of csproj

This is after chaining to SLN or set AnyCPU

1

1 Answers

0
votes

what could be the possible reasons for this behavior?

According to the images you provided, I could reproduce this issue if I select the project file .csproj instead of solution file .sln in the Visual Studio build task:

enter image description here

That because if we select the project file .csproj, there is a warning when we build the project:

Warning : The OutputPath property is not set for project 'ASP.NETMVC.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='release'  Platform='any cpu'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

enter image description here

Although the result of the task is passed, the output is not output correctly due to the above warning.

That the reason why you build is successfully, but bin folder is not generated.

To resolve this issue, we select the solution file in the Visual Studio Build task:

enter image description here

Then the warning disappeared, and bin folder is generated:

enter image description here

Update:

when i select the solution instead of the csproj i got errors related to the unsuccessful builds due to some missing references.

That because you just restore the one of packages.config file in the nuget restore task. You need to change it to the .sln file instead of packages.config file.

Besides, to resolve your previous issue, we could choose the .sln file instead of the project file (I answered before.). Or you could change the default variable BuildPlatform from any cpu to AnyCPU (move the space).

Hope this helps.