Hi,

It's not exactly clear to me what you're trying to achieve.

Apparently, you're creating a blank pdb from scratch for an assembly,
and expect VS to be able to use it for debugging. Sadly that's now how
it works :) A pdb contains sequence points that the debugger uses to
be able to place breakpoints.

If you have a pdb for an assembly that differs from an assembly only
by its strong name, metadata wise, the easiest thing to do is to patch
the pdb to change the module GUID in it, and you're good to use it in
VS.

On Tue, Dec 6, 2011 at 3:07 AM, Tolis <[email protected]> wrote:
> Hi
> I have a symbol file generated for an assembly. I want to use the same
> symbol file for another assembly that differs only by its strong key.
> I do not want to tamper the second assembly I just want to be able to
> debug it. I have tried a code similar to
>
>             foreach (var file in GetFiles(path)) {                 try
> {                     fileName = Path.GetFileName(file);
>       Console.WriteLine("Creating symbols for " + fileName);
>           var publish = new
> System.EnterpriseServices.Internal.Publish();
> publish.GacRemove(file);                     var assemblyDefinition =
> AssemblyDefinition.ReadAssembly(file, new ReaderParameters());
>             var writerParameters = new WriterParameters { WriteSymbols
> = true };                     assemblyDefinition.Write(file,
> writerParameters);                     publish.GacInstall(file);
>               Console.WriteLine("Symbols created for " + fileName);
>               } catch (BadImageFormatException) {                 }
> catch (Exception e) {                     Console.WriteLine("Error
> with " + fileName + e.Message);                 }             }
> The pdb file is generated and VS module list says that symbols are
> loaded ok. However debugging is not possible
> On Nov 29, 4:35 am, Tolis <[email protected]> wrote:
>> Hi
>>
>> I have used the approach from 
>> githubhttps://github.com/jbevain/cecil/wiki/Debug-symbols.
>> The pdb was created and I have checked its validity 
>> usinghttp://www.debuginfo.com/tools/chkmatch.html. I run the executable and
>> attach to its proccess using VS2010. In the modules list I see that
>> symbols are loaded however my breakpoints are disabled
>
> --
> --
> mono-cecil

-- 
--
mono-cecil

Reply via email to