Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2010-05-06 10:09:03 +0400
committerjfrijters <jfrijters>2010-05-06 10:09:03 +0400
commit8b9c9843c6fb04e8d80d5be7b6c6e37b6d91a84e (patch)
tree712db62295c74982180893166becabf97335fbdd /reflect/Impl
parent6e3e5cdc5e6cc3b3919e3c5f79a8f1cce8041540 (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.cs4
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;