Azure Devops build fails Warning MSB3245: Could not resolve this reference












1














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
Studio2017EnterpriseMSBuild15.0BinMicrosoft.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.




  1. ABC which is the actual application


  2. 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:




  1. Build ABC project => ABC.dll is generated


  2. Add reference in ABC.UnitTests proj to ABC.dll


  3. 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.




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Build the project in Azure DevOps => reference issue reported


I have a YAML config file with name azure-pipelines.yml which references the hosted 2017 agent.



pool: vmImage: 'vs2017-win2016' 


Alternate flow:




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Comment out the reference to ABC.UnitTests project from the sln file

  3. Create the pipeline => build successful.










share|improve this question
























  • this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
    – Cosmin
    Nov 10 at 20:48






  • 1




    you should not refer the DLL like this. Instead, you should refer the Project directly like this
    – Jayendran
    Nov 11 at 4:01










  • Yes, that was it. Thanks a lot for your help, I was stuck for ages.
    – Cosmin
    Nov 11 at 10:43










  • I've expanded my comment as the answer, please accept it. so that it might help others too
    – Jayendran
    Nov 11 at 11:02
















1














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
Studio2017EnterpriseMSBuild15.0BinMicrosoft.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.




  1. ABC which is the actual application


  2. 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:




  1. Build ABC project => ABC.dll is generated


  2. Add reference in ABC.UnitTests proj to ABC.dll


  3. 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.




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Build the project in Azure DevOps => reference issue reported


I have a YAML config file with name azure-pipelines.yml which references the hosted 2017 agent.



pool: vmImage: 'vs2017-win2016' 


Alternate flow:




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Comment out the reference to ABC.UnitTests project from the sln file

  3. Create the pipeline => build successful.










share|improve this question
























  • this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
    – Cosmin
    Nov 10 at 20:48






  • 1




    you should not refer the DLL like this. Instead, you should refer the Project directly like this
    – Jayendran
    Nov 11 at 4:01










  • Yes, that was it. Thanks a lot for your help, I was stuck for ages.
    – Cosmin
    Nov 11 at 10:43










  • I've expanded my comment as the answer, please accept it. so that it might help others too
    – Jayendran
    Nov 11 at 11:02














1












1








1







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
Studio2017EnterpriseMSBuild15.0BinMicrosoft.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.




  1. ABC which is the actual application


  2. 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:




  1. Build ABC project => ABC.dll is generated


  2. Add reference in ABC.UnitTests proj to ABC.dll


  3. 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.




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Build the project in Azure DevOps => reference issue reported


I have a YAML config file with name azure-pipelines.yml which references the hosted 2017 agent.



pool: vmImage: 'vs2017-win2016' 


Alternate flow:




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Comment out the reference to ABC.UnitTests project from the sln file

  3. Create the pipeline => build successful.










share|improve this question















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
Studio2017EnterpriseMSBuild15.0BinMicrosoft.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.




  1. ABC which is the actual application


  2. 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:




  1. Build ABC project => ABC.dll is generated


  2. Add reference in ABC.UnitTests proj to ABC.dll


  3. 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.




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Build the project in Azure DevOps => reference issue reported


I have a YAML config file with name azure-pipelines.yml which references the hosted 2017 agent.



pool: vmImage: 'vs2017-win2016' 


Alternate flow:




  1. Upload the solution from local VS2017 and a project is created in Azure

  2. Comment out the reference to ABC.UnitTests project from the sln file

  3. Create the pipeline => build successful.







visual-studio azure visual-studio-2017 azure-devops






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 4:01









Graham

3,523123558




3,523123558










asked Nov 10 at 20:28









Cosmin

274




274












  • this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
    – Cosmin
    Nov 10 at 20:48






  • 1




    you should not refer the DLL like this. Instead, you should refer the Project directly like this
    – Jayendran
    Nov 11 at 4:01










  • Yes, that was it. Thanks a lot for your help, I was stuck for ages.
    – Cosmin
    Nov 11 at 10:43










  • I've expanded my comment as the answer, please accept it. so that it might help others too
    – Jayendran
    Nov 11 at 11:02


















  • this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
    – Cosmin
    Nov 10 at 20:48






  • 1




    you should not refer the DLL like this. Instead, you should refer the Project directly like this
    – Jayendran
    Nov 11 at 4:01










  • Yes, that was it. Thanks a lot for your help, I was stuck for ages.
    – Cosmin
    Nov 11 at 10:43










  • I've expanded my comment as the answer, please accept it. so that it might help others too
    – Jayendran
    Nov 11 at 11:02
















this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
– Cosmin
Nov 10 at 20:48




this is how I reference the main project in the .csproj of the MSTest proj <ItemGroup> <Reference Include="ABC"> <HintPath>..ABCbinDebugnetcoreapp2.1ABC.dll</HintPath> </Reference> </ItemGroup>
– Cosmin
Nov 10 at 20:48




1




1




you should not refer the DLL like this. Instead, you should refer the Project directly like this
– Jayendran
Nov 11 at 4:01




you should not refer the DLL like this. Instead, you should refer the Project directly like this
– Jayendran
Nov 11 at 4:01












Yes, that was it. Thanks a lot for your help, I was stuck for ages.
– Cosmin
Nov 11 at 10:43




Yes, that was it. Thanks a lot for your help, I was stuck for ages.
– Cosmin
Nov 11 at 10:43












I've expanded my comment as the answer, please accept it. so that it might help others too
– Jayendran
Nov 11 at 11:02




I've expanded my comment as the answer, please accept it. so that it might help others too
– Jayendran
Nov 11 at 11:02












1 Answer
1






active

oldest

votes


















1














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






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243123%2fazure-devops-build-fails-warning-msb3245-could-not-resolve-this-reference%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    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






    share|improve this answer


























      1














      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






      share|improve this answer
























        1












        1








        1






        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






        share|improve this answer












        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 11:01









        Jayendran

        3,15631336




        3,15631336






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243123%2fazure-devops-build-fails-warning-msb3245-could-not-resolve-this-reference%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini