diff options
author | jfrijters <jfrijters> | 2010-05-06 10:09:03 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2010-05-06 10:09:03 +0400 |
commit | 8b9c9843c6fb04e8d80d5be7b6c6e37b6d91a84e (patch) | |
tree | 712db62295c74982180893166becabf97335fbdd /reflect/Impl | |
parent | 6e3e5cdc5e6cc3b3919e3c5f79a8f1cce8041540 (diff) |
Delete .pdb file before initializing PDB writer to make sure we get a sensible exception, instead of the random COM error that the PDB writer produces.
Diffstat (limited to 'reflect/Impl')
-rw-r--r-- | reflect/Impl/PdbWriter.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/reflect/Impl/PdbWriter.cs b/reflect/Impl/PdbWriter.cs index ab9484a1..c3ea0e48 100644 --- a/reflect/Impl/PdbWriter.cs +++ b/reflect/Impl/PdbWriter.cs @@ -306,9 +306,11 @@ namespace IKVM.Reflection.Impl { if (symUnmanagedWriter == null) { + string fileName = System.IO.Path.ChangeExtension(moduleBuilder.FullyQualifiedName, ".pdb"); + // pro-actively delete the .pdb to get a meaningful IOException, instead of COMInteropException if the file can't be overwritten (or is corrupt, or who knows what) + System.IO.File.Delete(fileName); IMetaDataDispenser disp = new IMetaDataDispenser(); symUnmanagedWriter = new ISymUnmanagedWriter2(); - string fileName = System.IO.Path.ChangeExtension(moduleBuilder.FullyQualifiedName, ".pdb"); object emitter; Guid CLSID_CorMetaDataRuntime = new Guid("005023ca-72b1-11d3-9fc4-00c04f79a0a3"); Guid IID_IMetaDataEmit = typeof(IMetaDataEmit).GUID; |