3

Question

I was wondering if anyone knows where I might find C# versions of the VB.NET code snippets built in to Visual Studio (2008)?

What are Code Snippets?

VB.NET has a wide-ranging collection of snippets that cover most of the basic tasks one might want to accomplish, i.e. File I/O, LINQ, DB connectivity, and so on. C# has a much smaller and narrower library, mainly stuff for NetFX 3.0, Refactoring, and something called "other", among one or two other items.

1
  • Which snippets in particular are causing you problems. VB has a collection of code snippets as well and most of the same that C# has Commented Dec 4, 2009 at 20:23

3 Answers 3

3

The code snippets should still work. Tools => Code Snippets Manager..., or the chord:

Ctrl+K, Ctrl+B

For example, prop Tab Tab gives:

public int MyProperty { get; set; }

with ability to step through the pieces to change. The full list is in the manager.

Sign up to request clarification or add additional context in comments.

1 Comment

Actually more snippets for Visual Basic are provided out of the box than are for C#.
1

Two resources that I've used before to get C# code snippets are

Got Code Snippets and Visual Studio 2005 Code Snippets which will give you a collection of over 400 different types of C# code snippets.

If there is a particular VB code snippet that you like you can alway use a tool to translate the code in C# and then create your own code snippet.

Good luck and hope this helps some.

1 Comment

Thanks! I was actually considering quickly throwing together a tool that would hook up to one of those online services and translate them in a single batch
1

Doh! Further searching revealed the following:

http://msdn.microsoft.com/en-gb/vstudio/aa718338.aspx

Visual C#

Task-Based Code Snippets This is a set of task-based code snippets in C# that can help you with programming tasks ranging from working with databases and windows applications to writing mobile device applications and networking programs. Note: Visual Basic versions of these snippets are included in the box.

Looks like this is exactly what I was looking for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.