Undeploy without compile?

Topics: Tips and Tricks
May 3, 2011 at 11:34 AM
Edited May 3, 2011 at 11:43 AM

Hi,

Is it possible to run an undeploy without compiling the solution first?

I am attempting to do this as part of a TFS build process. I want to undeploy everything as one of the first build steps. I don't want to compile the solution with anything still in the GAC.  However, I keep getting an error like this because the DLL’s are not compiled yet in the clean solution.

The "GenerateAssemblyNamesItemGroup" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly XXXXX.Orchestrations.dll' or one of its dependencies.

Coordinator
May 3, 2011 at 3:03 PM

Hi Charlie,

The reason that this step is required is that the GAC may contain multiple versions of the same assembly.  If the undeploy did a blanket un-GAC using the DLL name or namespace, then gacutil would rip every version of the DLL out of the GAC in one operation.  That could have some bad side-effects, so I designed it to grab specific assembly names from the DLL's and feed those to gacutil.

I'm afraid there is no simple workaround for this one.  This particular logic is found throughout the "UndeployARTIFACT" build targets.  About the simplest ugly workaround might be to override IncludeSchemas, IncludeOrchestrations, IncludePipelines, etc. to false via the command line call to MSBuild.  That will have the effect of skipping those undeploy steps.  You could add your own calls to gacutil to un-GAC your various assemblies.  The "delete BizTalk app" undeploy step should still run, which should rip everything out of the BizTalk config db.

Thanks,
Tom