Be Careful Copying From Windows Calculator–Hidden Characters are Pre-Pended and Appended

I was using the Windows Calculator app to convert bytes to mebibytes and when I copied the value from the app to my nlog.config file, nlog blew up on me.  I didn’t make the connection right way so it took me ~30mins of debugging to see what was going on.

image

The first value I copied and pasted.  The 2nd value I manually typed in.

image

Using the built-in ASCII –> HEX we can see they are different!

image

 

Background

Diff Merge

image

NLog Exception

2017-03-17 12:18:07.7561 Error Parsing configuration from C:\Users\mdepouw\Source\Repos\Some App\Some App\DealBank.Web\nlog.config failed. Exception: NLog.NLogConfigurationException: Exception when parsing C:\Users\mdepouw\Source\Repos\Some App\Some App\DealBank.Web\nlog.config.  —> NLog.NLogConfigurationException: Error when setting property ‘ArchiveAboveSize’ on File Target[allfile] —> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s