I was just writing a utility assembly for the startup handling of my applications. That thing is called ….Startup.dll, which kind of made sense to me and resides within a folder called Startup in my source code hierarchy. No problem that far. Things started to behave weirdly when I created a small test app, a separate project in a subfolder of the Startup folder. Suddenly I got an error from Visual Studio: CS0016, … can’t write to file …\test.startup.exe: access denied.
Usually this kind of problem has something to do with the funny methods that VS uses to access IntelliSense information for the IDE. That’s been a known problem in VS.NET 2003 for a long time and although I was using v2005, I thought maybe it had to do with that. Restarted, looked around… no change. I tried to create another project in another place and found out bit by bit that actually the path where the project was stored was the issue here.
To make a long story short: I found that McAfee VirusScan was the source of the problem. I’m using the Enterprise 8 version, no idea about others. That thing has a feature called “Access protection”, which performs some port blocking and others functions. Under the option name Prevent access to suspicious startup items (.exe) it implements a protection for the Startup folder… but not only for the Startup folder, but for all folders that are called Startup. Wow.
By configuring the access protection via the VirusScan Console, it’s possible to switch that option off and everything’s back to normal. Now back to my startup utility 🙂