views:

599

answers:

3

We have a C# ASP.NET 3.5 project with VS 2008.

We also have a VB6 DLL that we call via Interop (yuck...I know).

We use a Web Deployment project with MsBuild and run a batch file to build the project on a build machine.

My question is:

Is there a way to modify the MSBuild project to have the VB6 DLL and interop files created and moved to the proper folders as a part of the build process?

Currently we have to manually build the VB6 DLL and interop file and move them to the appropriate folders first then run the MSBuild batch file.

Any ideas?

+1  A: 

Use MSBuild Exec task to call the VB6.exe Dev project with the /make switch. Then use the MSBUILD copy Task to copy the known output to the location that you want it.

David McEwing
+1  A: 

You can build the VB6 DLL from the command-line, if you can insert commands into the MSBuild batch file somehow. Just run the VB6 IDE (VB6.exe) with the command-line switch /make and pass the path to the VBP project file. Run VB6.exe with /? if you want to see a list of the other command-line switches.

I'm not sure how to automate the creation of the interop file, but a quick Google search suggests Tlbimp might be worth a try.

I will leave the commands to copy the output to the required directory as an exercise for the reader;)

MarkJ
A: 

Alternativly, you could look at an automated build tool such as FinalBuilder which you can script easily via a gui to do anything you like including what you ask above. link text

MaSuGaNa