Red Gate forums :: View topic - Assembly dependencies and MsBuild task
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Assembly dependencies and MsBuild task

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
raffaeu



Joined: 12 Dec 2011
Posts: 20
Location: Bermuda

PostPosted: Fri Dec 23, 2011 4:04 pm    Post subject: Assembly dependencies and MsBuild task Reply with quote

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:
Code:

- 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?
Back to top
View user's profile Send private message
raffaeu



Joined: 12 Dec 2011
Posts: 20
Location: Bermuda

PostPosted: Fri Dec 23, 2011 4:36 pm    Post subject: Reply with quote

Just to let you know, I got this problem fixed with the following technique.
This is my project structure in Visual Studio
Code:

+ Solution Dir
   + UI Project (ClickOnce)
   + Domain project (.dll)
   + Data Layer project (.dll)
   + Service project (.dll)
   - .saprj file (in the root)

This is my .saprj file where I specify to TFS how to resolve dynamically the dependencies:
Code:

          <Assembly AssemblyName="TestSA.DataLayer, Culture=neutral, PublicKeyToken=null" MandatoryPath=".\TestSA.DataLayer\obj\Release\TestSA.DataLayer.dll">
            <Merging />
            <Embedding />
          </Assembly>
          <Assembly AssemblyName="TestSA.Domain, Culture=neutral, PublicKeyToken=null" MandatoryPath=".\TestSA.Domain\obj\Release\TestSA.Domain.dll">
            <Merging />
            <Embedding />
          </Assembly>
          <Assembly AssemblyName="TestSA.ServiceLayer, Culture=neutral, PublicKeyToken=null" MandatoryPath="TestSA.ServiceLayer\obj\Release\TestSA.ServiceLayer.dll">
            <Merging />
            <Embedding />
          </Assembly>

In this way I have a dynamic way of structuring my solution in TFS without the need to touch anything except the saprj file!
Very Happy

PS: I hope this may help somebody else too.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Tue Dec 27, 2011 2:10 pm    Post subject: Reply with quote

Hello,

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

Thanks for your solution.
Back to top
View user's profile Send private message
raffaeu



Joined: 12 Dec 2011
Posts: 20
Location: Bermuda

PostPosted: Wed Dec 28, 2011 8:05 pm    Post subject: Reply with quote

That really fixed my problem.
Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group