Reputation: 107
I'm trying to create a pipeline in Azure DevOps and I get compilation errors caused by a missing reference:
[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "ABC". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
I have a VS2017 solution with 2 projects.
ABC which is the actual application
ABC.UnitTests where I added some unit tests (I'm using MSTest)
When I build the solution locally, I'm able to do a successful build with the following steps:
Build ABC project => ABC.dll is generated
Add reference in ABC.UnitTests proj to ABC.dll
Build the entire solution => build successful
The .cs file in ABC.UnitTests references the application in this way, and generates the warning above:
using ABC;
If I do a clean build where ABC.dll is deleted and then I do a build of the entire solution I get the same MSB3245 warning. So the issue is reproducible locally if the dll does not exist.
Then, when I upload the solution to Azure DevOps, I do the following steps.
I have a YAML config file with name azure-pipelines.yml which references the hosted 2017 agent.
pool: vmImage: 'vs2017-win2016'
Alternate flow:
Upvotes: 1
Views: 5294
Reputation: 10910
You shouldn't refer any DLL as you mentioned in the comment.
The proper way is to refer to as a project. This way the DLL takes care of itself during the build
Proper way is
References
-> (Right Click) Add References
-> From that using Projects tab
you can choose the Project which is generating that DLL(assemblies)
You can refer this SO
Upvotes: 2