oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.57k stars 234 forks source link

Bugfix when using embedded PDBs, #278 #279

Closed burberger closed 2 years ago

burberger commented 2 years ago

I missed this when reviewing https://github.com/oleg-shilo/cs-script/commit/9209e8498fd200d4dee2650df35bf2d94c743e89 as part of #278. If an embedded PDB format is specified when calling compilation.Emit, a PDB output stream cannot also be specified or the call will throw an exception. I've added a special case for the call to compilation.Emit and skipped the file write when the PDB stream is not used. I've tested this on my private repository which uses the feature and it works as intended.

oleg-shilo commented 2 years ago

Thank you, I have merged it with a tiny optimisation of the if logical statement. Can you please test the package before I publish it: https://github.com/oleg-shilo/cs-script/releases/tag/v4.4.1.0