The daily WTF - time to laugh at me

Started by
13 comments, last by jyumai 7 years, 3 months ago

Finally, I found some spare time at home to test a concept I was thinking about in a while. Without much thought, I started Visual Studio, created a blank console C# project, giving it the name 'Test'. How imaginative of me! Then out of habit I hit F5 to build and run it. To my surprise Visual Studio complained it could not create the file 'Test.exe', because the access to the path was denied. Wait! It was just a blank console project with an empty 'Main' method in it. If I fail to compile that, then what?

I tried the obvious things first like clean rebuild etc. to no avail. Then I tried to restart Visual Studio, delete the 'bin' and 'obj' folders in my project manually and then rebuild. Same outcome. Then I tried to restart Windows, delete the 'bin' and 'obj' folders in my project manually and then rebuild. Same thing. Then I tried to disable my antivirus program temporarily, suspecting it was confusing my poor empty console program with some nasty virus. Nope, it was not the antivirus.

During my struggles, I found something new however. The 'bin' folder was locked when the project was open in Visual Studio, while closing the project unlocked it. Deleting the 'bin' folder and reopening the project caused the 'bin' folder to be recreated and locked back again. The culprit always was some child process in Visual Studio, namely 'VBCSCompiler.exe'. So, it was the C# compiler itself locking the 'bin' folder and then failing to write 'Test.exe' in there!

I spent the rest of my spare time Googling about the problem to no avail. Finally, I had to tend to other matters, so I deleted the useless project and left home.

When I returned home, I recreated the console project. This time everything compiled without problem. After toying with my testbed for a while, I noticed there was a typo in the project's name: it was called 'Tset', instead of 'Test'. I hate such small mistakes, so I renamed the project to 'Test'. To my surprise, the problem with the locked folder reappeared. I was starting to feel I was going crazy, when it finally occurred to me. Went to project properties, renamed the generated executable from 'Test' to 'Test1' and it compiled normally. Renaming the executable back to 'Test' prevented me to compile again. So, it seemed I was unable to compile, when I put the name 'Test'. I tried with different project types and the problem reproduced always. C++ projects seemed unaffected, so my guess was it had something to do with the C# compiler.

And now the moral of the story is: do not give stupid names to your projects, otherwise the compiler will bite you!

Advertisement

Well, it seems the daily WTF is that I cannot find how to rename 'The daily WPF' to 'The daily WTF' in the title of this post! :)

You will never live this down. I’ll tell my grandchildren about this.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Arguably the most core piece of our multi-million dollar application is named "webapplication1"

Hahahaha, I like stories like that.

They simply add to my knowledge of how fucked up the software world is... (And I generally try to avoid fucked up things).

Generally when file is locked try ProcessExplorer (windows) ,locate the handle and simply close it :)

Generally when file is locked try ProcessExplorer (windows) ,locate the handle and simply close it :)

True enough. This is how I discovered it was VBCSCOMPILER.exe locking the folder. Unfortunately, killing it unlocked the folder only temporarily, until I tried to recompile...

Hahahaha, I like stories like that.
They simply add to my knowledge of how fucked up the software world is... (And I generally try to avoid fucked up things).

Generally when file is locked try ProcessExplorer (windows) ,locate the handle and simply close it :)


Ugh process explorer. So useful and so annoying.

It's had a memory leak in it for getting close to a decade now that nobody has fixed despite being reported dozens of times to sysinternals and ms.

Try leaving it running for a few weeks on a server which rapidly spawns short lived processes, and see what happens.

THAT is my own wtf... :(

Arguably the most core piece of our multi-million dollar application is named "webapplication1"


No it's not.

Yes it is.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Arguably the most core piece of our multi-million dollar application is named "webapplication1"


No it's not.

Yes it is.


L. Spiro

http://i.imgur.com/FANHfcf.png

http://i.imgur.com/lXf5FdL.png

http://i.imgur.com/TGht0GC.png

Don't worry, even our CEO stopped caring about naming conventions after enough time.

This topic is closed to new replies.

Advertisement