This project has moved and is read-only. For the latest updates, please go here.

Undeploy without compile?

Topics: Tips and Tricks
May 3, 2011 at 12:34 PM
Edited May 3, 2011 at 12:43 PM


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.

May 3, 2011 at 4: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.