I have created a VS build definition on Team Services. The build runs successfully when I queue it and it also outputs the dlls for all the projects in the solution except the service layer which I have created using Web Api2.
when I download the artifacts from the drop location, I have folders holding the dlls for the data layer, the business layer and other helper projects. What I don't have is the main service layer dll which I can deploy to my IIS.
Here is a screenshot of my publish settings.
What could I be missing ?
Publish Web API from Visual StudioRight click on Web API project and click “Publish” menu. Now click “Ok” and move on Connection tab in Publish Web.
Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish. Visual Studio writes the files that comprise your application to the local file system. The Publish tab now shows a single profile, FolderProfile.
On the computer where you have the ASP.NET project open in Visual Studio, right-click the project in Solution Explorer, and choose Publish. If you have previously configured any publishing profiles, the Publish pane appears. Click New or Create new profile. Select the option to import a profile.
It seems that you are using the default settings for the build definition. With these settings, the contents for "Copy Files" task is "**\bin\$(BuildConfiguration)**" while web api project does not have buildconfiguration folder. So it cannot find the files for web api project. To copy these files, add one more "Copy Files" task and configure the settings as following:
If you want the deployment files for the project, you need to set you build definition as following:
/p:DeployOnBuild=true;OutDir="$(build.artifactstagingdirectory)"
for Visual Studio Build
step.Copy Files
step.$(build.artifactstagingdirectory)\\_PublishedWebsites
for Publish Build Artifacts
step.Then you should get the deployment files in the drop folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With