2

We've got the following problem:

solution-structure: AutofacRegistration References: Repositories.dll

WebApplication References: AutofacRegistration.dll

In our web application we are referencing the AutofacRegistration.dll and this assembly references Repositories.dll. Repositories.dll is instantiated on runtime per IOC-Container.

When we build the solution in VS2010 and browse the web app everything is working fine, as expected.

When we use our build server(TFS 2010) und use the web deployment, the Repositories.dll is missing the web-app\bin folder and we got a runtime exception(when we want to instantiated a class in Repositories.dll)

But Repositories.dll is in our drop location, so the web deployment target does not copy this file, any ideas how to solve this??

John Saunders
  • 160,644
  • 26
  • 247
  • 397
rene_r
  • 936
  • 1
  • 6
  • 15

1 Answers1

1

Have you tried a copy task from the BuildTemp location to where your Web Deployment Project can pick up the file it needs?

 <Copy SourceFiles="$(OutDir)\Repositories.dll" DestinationFiles="web-ap\bin\Repositories.dll" />

The paths will need modified but you get the idea. I do a similar function in MSBuild to move a dll for our installer to pickup.

Mike Veigel
  • 3,795
  • 2
  • 20
  • 28
  • Hi, I got the idea. And I think it will work but, its cumbersome, because we have to do it for every new assembly which is not used until runtime! Any other ideas?? thx in advance! – rene_r Jul 29 '11 at 08:45
  • Yes you will... another idea would be to use wildcards if all the future dlls would be in the same folder. You can always create a build task too and exec that during the build and code a sln in c# I agree, it is a little maintenance but our team has been running smoothly with a similar setup for a year so don't worry too much about it. – Mike Veigel Jul 29 '11 at 08:49
  • The idea with the wildcards is great, I will try it on monday. Have you a link which shows a sample how to do it with tfs 2010? that would be very helpful! thx for your answers! – rene_r Jul 30 '11 at 07:35
  • http://msdn.microsoft.com/en-us/library/3e54c37h.aspx or http://blogs.msdn.com/b/msbuild/archive/2005/11/07/490068.aspx should help you out – Mike Veigel Aug 01 '11 at 16:55
  • But me would interests why is this behavior? It is part of optimization? – Anton Kalcik Aug 03 '11 at 10:07