Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Querying With LINQ Querying the BirdWatcher Data How Much Data Do We Have?

Radu - Adrian Buha
PLUS
Radu - Adrian Buha
Courses Plus Student 5,535 Points

Is there a better Workspace Alternative?

Hello,

I seem to have some problems lately with my workspace, especially on this video tutorial, I cannot seem to be able to type the last query from tutorial into my workspace REPL. I have already contacted Treehouse Support and I'm wainting on their response. In the meantime I was curios if there is a way I can use the Bird repository in Visual Studio's "C# Interactive", or is there another REPL solution that I can use?

Thanks, Radu

4 Answers

Andrew Parker
Andrew Parker
19,455 Points

I got this working in Visual Studio without using the BirdWatcher.dll. I believe it's just using the code in the BirdRepository.cs class anyway. You can download the workspace files by going to File > Download Workspace. Then in your Visual Studio project you can add these existing files / classes. Just make sure your main method class has the namespace BirdWatcher to match the others. Here was mine:

using System;
using System.Collections.Generic;
using System.Linq;

namespace BirdWatcher
{
    class Program
    {
        static void Main(string[] args)
        {
            var birds = BirdRepository.LoadBirds();
            Console.WriteLine(birds.Count());
        }
    }
}

Although this isn't for the REPL, at least you can play around with the commands she uses by printing them to the console using WriteLine.

This works, thank you Andrew Parker.

Alec Meyer
Alec Meyer
6,303 Points

If you want to use the C# Interactive REPL via Visual Studio do as Andrew Parker suggested above by downloading the workspace. Then inside of the c# interactive window use the special #r (for reference command).

#r "c:\Users\YourUserName\Downloads\project\BirdWatcher.dll"

This will be the same as the LoadAssembly("path") that the instructor is using.

This works, thank you Alec Meyer.

Curtis Vanzandt
Curtis Vanzandt
9,165 Points

You could download the free version of Visual Studio and save these tutorials on your computer! That way, you have the basic steps to look back on if need be.

Radu - Adrian Buha
Radu - Adrian Buha
Courses Plus Student 5,535 Points

I already have the Visual Studio installed. My question was how do I load the Bird repository into Visual Studio's "C# Interactive"?

Larry Davis
Larry Davis
6,007 Points

Excellent! Thank you all for the help.