hintpath for local dll in azure pipeline in csproj file - msbuild

Bellow is my project structure and build order
Authentication.Logics project has dependency on Authentication.DTOs and Authentication.MQ
When I try to build the solution with Azure Pipeline ,the build is failed because Pipeline Build cannot find the referenced DLLs ,because path is different in build agent .
How to resolve this issue , so my both Local and Pipeline build runs successfully .
I don't want to publish these dlls in Nuget .

Related

Azure DevOps Build pipeline failed for DownloadPipelineArtifact#2

Build pipeline failed for below DownloadPipelineArtifact#2 task in my VB.Net App Deployment.
##[error]No builds currently exist in the pipeline definition supplied.
Code for DownloadPipelineArtifact#2 task in azure-pipelines.yml file is displayed as seen below:
Requesting assistance on the same.
That task fails because you havent published an artifact with that pipeline.
you have 2 different ways to publish artifacts:
publish build artifacts (deprecated) used mostly in classic pipelines
can only be downloaded with download build artifact step
publish pipeline artifacts are used to publish an artifiact available for this same build or another pipeline
can only be downloaded from a download pipeline activity
You need to publish your build using publish pipeline artifact first (check if not already).
So first check the source pipelien with definition 370 from Project StarsDemo, and see if the latest build published an artifact or had an issue.
Also, per documentation, the runId is required (aka pipelineId, buildId).
I was able to resolve the issue by changing runVersion value to latest instead of latestFromBranch , after which the pipeline build successfully.

How I can Push number build from Azure DevOps Pipelines to file *.csproj (project ASP.NET CORE)?

I am beginner to A and just starting to work in it
What task I must add in project ASP.NET CORE to Azure DevOps Pipelines to pass the build number from the azure devops pipeline to the project code
Client.Shell.csproj:
<MinimumRequiredVersion> 4.60.0825.700 </MinimumRequiredVersion>
<ApplicationRevision> 716 </ApplicationRevision>
<ApplicationVersion> 4.60.0825.% 2a </ApplicationVersion>
https://i.stack.imgur.com/BXyHm.png
You can do something like this, Replace "1.2.3" with your build parameter.
dotnet publish ./MyProject.csproj /p:Version="1.2.3" /p:InformationalVersion="1.2.3-qa"
Look at this https://github.com/dotnet/docs/issues/7568
When a pipeline runs, it usually performs get sources action first. So you just need to map the correct project path, then the pipeline will get entire project to the Agent's working folder.
To update the version in .csproj file, and to pass the build number from the azure devops pipeline, you can check Assembly Info extension, and use the variable $(Build.BuildNumber) in the version field.
This extension can update project AssemblyInfo files and .Net Core / .Net Standard project files .csproj. For detailed instructions on how to configure the extension please see the following link:
https://github.com/BMuuN/vsts-assemblyinfo-task/wiki/Versioning
If you want to update the file in repo, you still need to run git push command to push the changes to the repo.

Deploying service fabric Visual studio build failing

I am trying to run the "Visual studio build task" in VSTS CI, but its failing with the following error:
Build error
I read it here bclbuildWhat does the Microsoft.Bcl.Build NuGet package do?
and passed the MSBuild arguments as /p:BclBuildImported=Ignore but still it complains that nuget restore didn't occur. What could be the problem?
Nuget restore task:
Nuget-restore task
Firstly make sure you can build the project locally with VS. Then add Nuget Restore task in the build definition to restore the packages.
UPDATE:
Just check your Nuget.config file, make sure you have set the correct feeds/package sources you want to consume and the package Microsoft.Bcl.Build.1.0.21 is included in the sources.
See Specifying sources in NuGet.config for details.
Besides, you can also try to create a new build definition with the Nuget restore task, then provide the nuget.config file and proper path to solution, also try with other Hosted agents.

Path for DataRoot in VSTS for USQL build defintion with USQLTargetType=SyntaxCheck for hosted agent

I am working on generating builds for U-SQL using
https://blogs.msdn.microsoft.com/azuredatalake/2017/10/24/continuous-integration-made-easy-with-msbuild-support-for-u-sql-preview/.
I got an error
"Error MSB4057: The target “Build” does not exist in the project working with Continuous integration with MSbuild for U-SQL
which I was able to fix it by referring to
Error MSB4057: The target "Build" does not exist in the project working with Continuous integration with MSbuild for U-SQL"
Currently I am blocked on one thing.
When I use USQLTargetType=SyntaxCheck in parameter it asks for DataRoot to be provided.
What path should I provide for DataRoot?
On my local machine I provided USQLDataRoot folder path and it works fine and builds successfully
I am using hosted agent for building solution
The DataRoot designates the folder on your local machine that will contain the local U-SQL catalog as well as the files that you can reference using the same relative path that you can use on the cluster.
So you would chose the folder that contains the data and meta data that you need for your build to succeed.

Referencing package path in VSO with DNX projects

I have to reference the test adapter DLL (xunit.runner.visualstudio.testadapter.dll) in our vNext Visual Studio Online build to execute the tests.
The problem is that with the new DNX structure, packages are being restored to C:\Users\{user}\.dnx\packages and are not relative to the project's path anymore.
How can I reference this location in the build?
We are using the hosted build agent.
I think the answer for your question can be found in the following StackExchange answer: Running unit tests in TFS/VSO Build vNext using xUnit adapter. Then the packages end up in a local directory and not the global .dnx cache.
...
Make a global.json file and put the following into it:
{
"packages": "packages"
}
That will force your dnu restore to put the packages into .\packages\, which will hopefully solve the problem.