tags:

views:

72

answers:

2

I have >443 projects to build and assemble for an application. roughly 1 in 4 is a WCF service. My new simplified build script (legacy is a dos batch file, .net app, msbuild spaghetti coded hybrid) is failing because the web.config file is not present when the _CopyWebApplication target runs. This file is part of the project for local developer testing and is not needed for release, as we have a master web.config elsewhere.

I'm using MSBuild 3.5 but 4.0 may be available.

A: 

override the target by importing a file at the bottom of your project with

<Target Name="_CopyWebApplication" />

This target is always a heinous pain, especially if you try and command the outdir properties. It's not that valuable in all.

Jimmy Hoffa
this is for a >450 project solution, additionally I'm not in a position to dictate an architecture change of that size. I've only got control over my build process, should I be able to make one better than what we have.
Maslow
+2  A: 

If you really, really can't modify existing build targets can you just let that dev web.config pass through and either detele to overwrite it latter, or just ignore it dependiong on deployment process? Say by making additional build target that will be invoked only in projects that need that cleanup? I'm pretty sure that you can find several places in your build where you can do a cleanup.

Alternatively you can inject a target earlier in the cycle to copy your master web.config to where you need it - the modality depends on your actual situation - there's no universaly best way to do it.

The issue is not going to dissapear if you just say "I don't dare to touch anything". You'll have to modify something either by making new target to copy, or clean up or by copying or cleaning up before/after the build.

You could also make 3 variants of the _CopyWebApplication - one that does everything like out of the box, another that does everything except trying to copy the file(s) no one wants and one empty - so you are not forcing anything but providing options.

ZXX
i've come back to this problem and I can't seem to get _CopyWebApplication to override properly, any hints?
Maslow