What are the challenges you face when working across database platforms? Take the survey
Options

Assembly dependencies and MsBuild task

raffaeuraffaeu Posts: 28
edited December 28, 2011 2:05PM in SmartAssembly
Hi everybody, I have sucesfully used your MsBuild task on multiple projects until the project does not have references to external .dlls
Right now I have the following application structure:
- Solution
   - Project UI (EXE ClickOnce)
   - Domain (.dll)
   - Data Layer (.dll)
   - Service (.dll)
The EXE project is using all the mentioned .dlls but when TFS builds the project in the obj folder it does not include the dependencies, so SA bombs telling me that it can't locate the dependencies.
Now, if I use your MsBuild target script, it doesn't copy the dependencies but only the target project.
How do you sort out this issue on your side? Do you have a custom MsBuild <copy> command?

Comments

  • Options
    Just to let you know, I got this problem fixed with the following technique.
    This is my project structure in Visual Studio
    + Solution Dir
       + UI Project &#40;ClickOnce&#41;
       + Domain project &#40;.dll&#41;
       + Data Layer project &#40;.dll&#41;
       + Service project &#40;.dll&#41;
       - .saprj file &#40;in the root&#41;
    
    This is my .saprj file where I specify to TFS how to resolve dynamically the dependencies:
              &lt;Assembly AssemblyName="TestSA.DataLayer, Culture=neutral, PublicKeyToken=null" MandatoryPath=".\TestSA.DataLayer\obj\Release\TestSA.DataLayer.dll"&gt;
                &lt;Merging /&gt;
                &lt;Embedding /&gt;
              &lt;/Assembly&gt;
              &lt;Assembly AssemblyName="TestSA.Domain, Culture=neutral, PublicKeyToken=null" MandatoryPath=".\TestSA.Domain\obj\Release\TestSA.Domain.dll"&gt;
                &lt;Merging /&gt;
                &lt;Embedding /&gt;
              &lt;/Assembly&gt;
              &lt;Assembly AssemblyName="TestSA.ServiceLayer, Culture=neutral, PublicKeyToken=null" MandatoryPath="TestSA.ServiceLayer\obj\Release\TestSA.ServiceLayer.dll"&gt;
                &lt;Merging /&gt;
                &lt;Embedding /&gt;
              &lt;/Assembly&gt;
    
    In this way I have a dynamic way of structuring my solution in TFS without the need to touch anything except the saprj file!
    :D

    PS: I hope this may help somebody else too.
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    If you're in that situation, setting a Mandatory Path for the assembly would be the way around it.

    Thanks for your solution.
  • Options
    That really fixed my problem.
    :wink:
Sign In or Register to comment.