The other day, I wasted quite some time trying to follow the ESRI website walkthroughs for getting started with C#/.NET before figuring out I was working with the tutorial for a pre-9.3 version.
I’ve had more luck with the tutorial for 9.3. The other day I was still wondering where to paste my snippets. This time, picking up where I left off, I did not get a similar error. I like to think that I have learned enough C# to make more sense of the code and its structure (i.e. making sense of the bracelet jungle). (But I have to admit I printed out the entire code, and scribbled all over it in ink to really get it.)
The only error I got upon building my solution was:
Error 1: Cannot register assembly <<myproject.dll> – access denied. Please make sure you’re running the application as administrator. Access to the registry key ‘HKEY_CLASSES_ROOT\myproject.dll…. is denied.
This, it appears, has to do with UAC (User Account Control) in Windows 7 (and Vista). What you do is you turn UAC off. And then you run Visual Studio as Administrator (right click the VS icon in the start menu, and select “Run as Admin”).
After I did so, the solution was built without any problems, and I could add my custom button from the Walkthrough project in ArcMap.