[C# Helper]
Index Books FAQ Contact About Rod
[Beginning Database Design Solutions, Second Edition]

[Beginning Software Engineering, Second Edition]

[Essential Algorithms, Second Edition]

[The Modern C# Challenge]

[WPF 3d, Three-Dimensional Graphics with WPF and C#]

[The C# Helper Top 100]

[Interview Puzzles Dissected]

[C# 24-Hour Trainer]

[C# 5.0 Programmer's Reference]

[MCSD Certification Toolkit (Exam 70-483): Programming in C#]


Why Visual Studio 2008?
I use VS 2008 on this site for a few reasons. First, it provides much better performance than newer versions. The new versions include a lot of tools of marginal benefit that slow Visual Studio greatly. If you have a newer model computer with lots of memory and a solid-state disk drive, then this may not be a big problem. If you have an older system, the difference can be huge. (On my old system I could start C# 2008 almost instantly, but Visual Studio 2022 took almost a minute to load at the best of times. Building and debugging performance is also slower.)

Second, Visual Studio is backward- but not forward-compatible. That means you can load a VS 2008 project in VS 2022, but you can't load a VS 2022 project in VS 2008. (You can copy and paste code from newer projects into older ones, but it's a pain.) Using VS 2008 allows the most people to use these examples. (AFAIK, all of these examples load in newer versions of Visual Studio. If you find one that doesn't, let me know and I'll try to help.)

Third, I use VS 2008 so I don't need to update examples when new versions of Visual Studio pop out every two years containing new features that no one wants.

Besides, the only newer feature that I really miss in VS 2008 is string interpolation. (Which should have been part of the first release of NET.)

Why won't the example work?
All of the examples work. The examples display the most important code snippets and sometimes you can copy and paste that code into your program.

However, many examples use code that is not shown in the post's text. In that case, you need to download the example program to see the additional dtails.

No, really, why won't the example work?
If you downloaded the example program and it still won't work, be sure that you unzipped the project files.

If you open the zip file in File Explorer, you can drill down to find the solution file. If you double-click it, some versions of Visual Studio will fail with the error:

The project file or web has been moved, renamed or is not on your computer.

Other versions of Visual Studio will act as if the project has loaded properly, but when you try to run you get an error because Visual Studio does not have permission to write inside the zip file.

The moral is, make sure you unzip the project.

Permission is granted to use the examples on this site under the Creative Commons Attribution 4.0 International license (CC-BY 4.0) using the following attribution:

Example code by Rod Stephens licensed under CC-BY 4.0.

I also recommend (but do not require) that you include the URL where you found the example in a comment inside your code so you can find it if you need to later.

© 2009-2023 Rocky Mountain Computer Consulting, Inc. All rights reserved.