February 23, 2006
I found an obscure bug today, a typo no less, but Im getting ahead of myself.
It turns out that C# allows you to use multiple not operators (!).
So: true == !!true and false == !!false
Why you would ever want to use this is beyond my small level of comprehension, but it made finding my bug a little harder.
if(!X and !!Y) then do something
it turns out it was meant to be
if(!X and !Y) then do something
The double bang is easily glossed over as your eyes are looking for its presence not checking there is a correct count of bangs.
Leave a Comment » |
C# |
Permalink
Posted by adammills
February 10, 2006
We deal heavily with dynamically created assemblies. We do system installs of our product almost never.
When we do I always encounter the dreaded FileLoadException Setup failed with hr = 0×80070005
For some reason the binder uses an obscure directory that does not have the correct permissions for ASPNET user to access. Which directory? I can never remeber.
Filemon from sysinternals does… it’s great (and free). It shows you all file access commands issued and whether they succeded or not. So its easy to find where your access is being denied.
In this case “c:\documents and settings\Default User\local settings\Application Data”
Leave a Comment » |
Things To Remember |
Permalink
Posted by adammills