Deploying PDB's when compiled in debug mode

Jun 9, 2008 at 9:51 PM
Curious if it's possible to have a solution deploy the PDB's to the GAC alongside the DLL's?

using this with SharePointInstaller is a great timesaver, however every time i repair a deployment, i have to re-deploy my pdb's for each assembly i need to debug manually.

Any thoughts?
Jun 26, 2008 at 5:26 PM
Please see this post :
Just be sure to copy your debug build dll.
Jun 27, 2008 at 2:47 PM

Thanks for the reply -- This method works great if you have all the development tools on the SharePoint server. Unfortunately, I have a remote SharePoint server which is used for our development purposes, and without the .pdb in the GAC, it will not debug.

No harm, though. I've got the nuisance of copying down to an art at this point :)
Jun 27, 2008 at 9:28 PM

We had a need to deploy the .PDB files into the bin directory with our .dlls, for the purpose of reporting exceptions with a custom exception handling class.
The way that we accomplished this was to recompile WSPBuilder with the following code change to AssemblyFileReference.cs, this may work for GAC deployment also, although I've not tested that.

private void FindAssembliesInDirectory(DirectoryInfo parentDir, SolutionDeploymentTargetType targetType, Dictionary<string, AssemblyInfo> assembliesFound)
    FileInfo[] dllFileInfoDLLs = parentDir.GetFiles("*.dll") as FileInfo[];
    FileInfo[] dllFileInfoPDBs = parentDir.GetFiles("*.pdb") as FileInfo[];
FileInfo[] dllFileInfoCombined = new FileInfo[dllFileInfoDLLs.Length + dllFileInfoPDBs.Length];
    dllFileInfoDLLs.CopyTo(dllFileInfoCombined, 0);
    dllFileInfoPDBs.CopyTo(dllFileInfoCombined, dllFileInfoDLLs.Length);
foreach (FileInfo dllFileInfo in dllFileInfoCombined)
if (FileProvider.IncludeFile(dllFileInfo))
            AddCandidateAssembly(dllFileInfo, targetType, assembliesFound);

foreach (DirectoryInfo childDir in FileProvider.GetDirectories(parentDir))
    FindAssembliesInDirectory(childDir, targetType, assembliesFound);



Productions the following xml in the manifest file.

<Assembly Location="[YourAssemblyName].pdb" DeploymentTarget="WebApplication" />

It would be very nice to get this behaviour via a configuration setting in a future version of WSPBuilder.
Hope that helps!