Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fody and/or Costura forces PDB generation #278

Closed
Bilge opened this issue Nov 19, 2016 · 16 comments
Closed

Fody and/or Costura forces PDB generation #278

Bilge opened this issue Nov 19, 2016 · 16 comments

Comments

@Bilge
Copy link

Bilge commented Nov 19, 2016

Fody/Costura forces a PDB to be generated and linked into the target executable even when PDB generation has been explicitly disabled in the build options. Fody/Costura must not override my preference to disable PDB generation.

I am unable to determine whether Fody or Costura is the source of this fault as I cannot use one without the other (Fody throws an exception at build time if there are "no configured weavers"). Since Costura is no longer maintained I hope the error is, in fact, with Fody and that it can be addressed.

@distantcam
Copy link
Member

I am unable to reproduce this.

Make sure the setting to disable PDB generation is set for all configurations (Debug, Release, etc).

@Bilge
Copy link
Author

Bilge commented Nov 19, 2016

Why would I ever disable PDB generation for all configurations? Perhaps you do not understand how configurations work; only one can be active at any given time, and therefore, I would only need to disable it for the active configuration, never all configurations.

As to your attempt to reproduce the issue, what exactly have you observed that makes you think this is not reproducible?

To be clear, disabling the PDB generation as per the instructions I linked will omit the PDB from the bin\Release folder, and if you were only looking there you might be fooled into thinking the PDB was not generated. However, it is generated in obj\Release and it is still linked into the target assembly at both locations which you can easily verify by running strings on it, using a hex editor, etc.

@distantcam
Copy link
Member

Steps I used to try and reproduce.

  • Created a new WPF application
  • Changed the settings for PDB generation as per the link provided for all configurations.
  • Installed Costura, Autofac, PropertyChanged.
  • Build.
  • Going to the output folder, there is no PDB file for the application I have just built.

@Bilge
Copy link
Author

Bilge commented Nov 19, 2016

As I suspected, you have only checked the bin\Release folder which is just a copy target directory, not the working directory for generated output.

@distantcam
Copy link
Member

At what point did I say I checked the bin\Release folder? I made sure that all configurations were set to not output debug info, and then checked bin\Debug and bin\Release after building both configurations.

@distantcam
Copy link
Member

Here's the full code I used to try and reproduce this. https://github.com/distantcam/PDBRepro

@Bilge
Copy link
Author

Bilge commented Nov 19, 2016

You should not be checking anything under bin. As I explained in my prior post, you must check in the obj folder for the presence of the PDB and/or use a hex editor on the executable or other tool to verify that the PDB has been linked to the output assembly.

@distantcam
Copy link
Member

image

You edited your post after I had seen it.

As explained in this issue - Fody/Costura#162 - linking to the PDB has nothing to do with Costura or Fody and cannot be disabled by the compiler.

@Bilge
Copy link
Author

Bilge commented Nov 19, 2016

This is patently false. Removing Fody will immediately cease generating,
and consequently linking, the PDB. I urge you to try it in your little test
project and see for yourself.

On 19 Nov 2016 02:48, "Cameron MacFarland" notifications@github.com wrote:

[image: image]
https://cloud.githubusercontent.com/assets/1298847/20452469/4b694e8a-ae45-11e6-8752-7be1fd0576f9.png

You edited your post after I had seen it.

As explained in this issue - Fody/Costura#162
Fody/Costura#162 - linking to the PDB has
nothing to do with Costura or Fody and cannot be disabled by the compiler.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#278 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAcuYjgbcpQ8_bkCd5W533MJvLrypcbHks5q_mN7gaJpZM4K3IYw
.

@distantcam
Copy link
Member

Now that I know what I'm looking for (the original description was not helpful) I can confirm this is a Fody bug. I can also reproduce the problem with PropertyChanged.

Looking at the https://github.com/Fody/Fody/blob/master/FodyIsolated/ModuleWriter.cs it always writes debug symbols regardless of whether the original assembly has them or not.

@Bilge
Copy link
Author

Bilge commented Nov 19, 2016

Is it something quick and easy to fix or not?

@SimonCropp
Copy link
Member

fody, and many addins, need the pdb to give better quality errors.

Is there some reason you dont wnat to produce a pdb?

@Bilge
Copy link
Author

Bilge commented Apr 23, 2017

@SimonCropp Certainly. It is because the full physical path to the PDB on the build machine is embedded in the executable which is a privacy concern.

@SimonCropp
Copy link
Member

wouldnt this suffice https://github.com/Fody/Costura/#includedebugsymbols ?

@Bilge
Copy link
Author

Bilge commented Apr 23, 2017

Since it has been over 6 months I no longer recall if I tried that. I believe I did exhaust all the options before giving up but I can't guarantee it.

@SimonCropp
Copy link
Member

ok fody no longer forces pdb generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants