BrandGhost

Social Media Assistant in C# .NET - IDE Setup [S1E2]

Interested in building your very own social media assistant in C#? In this series, we work through building out an application using #dotnet where we interface with popular social media platforms to get analytics and eventually help with content creation! In this episode, I work with Jamal to help get his environment setup including installing visual studio and git extensions! We clone down an existing repository and then create our first project. The code for this project can be found here: h...
View Transcript
Today, Jamal, we're going to be diving into getting your environment set up so that you and I can collaborate on this project together. And we're going to have to get a couple tools installed on your side. And then that way, uh, if you're coding and making progress on things, you'll be able to, um, push changes up in source control and I will be able to pull them down, uh, make changes myself, push those up, and then, you know, you can pull those down. So, it'll be a back and forth kind of thing where we'll both be able to contribute to a common code base and make progress on things. So, how does that sound? That sounds good. And uh for those of you listening that uh didn't really get or understand what Nick just said, don't worry because neither did I. So, uh we're on the same page and that's why we're starting from absolute scratch. We're going to download we're going to start with what are we starting with, Nick? VS Code. We're going to be Yeah, we're going to get Visual Studio Community actually. Um I think just for this as we go through it I think that if folks are interested Visual Studio Code is extremely popular uh totally free. Um I think just for our purposes because I am more familiar with uh just the straight up Visual Studio um you know software package it's it'll be easier for me to kind of point you to hey like go go click this menu go do this thing. Um, but for anyone that wants to follow along, Visual Studio Code is a like an awesome option. It's extremely extensible. Um, you just have to know kind of what packages and stuff you want to install to kind of configure it. But, uh, we'll go ahead and get Visual Studio Community. So, Jamal, if you want to kick us off with that, um, that'll be what we do first. All right, let's get started. Okay, Nick. Now we have our browser open with Visual Studio. I've Googled Visual Studio Community. It's taking me to the download page. I'll actually just go like this. So, I'm just going to go ahead and download it. Probably take me to a secondary page. Here we go. The setup started. Very good. We're going to hop on over and install it. Just install it right from the browser. Cool. Yeah. So, you're going to want to pick uh Visual Studio Community right from the top there. that top entry. Just press install. All right. And there's going to be a bunch of options and stuff that come up. I think for what we need today, we probably only want uh .NET desktop development, uh, which is right below your cursor there. But I'm going to recommend two. The very first entry that says ASP.NET and web development. I think you're going to want to grab that as well because um if I'm predicting some of our future together, we might want to have that installed in your computer as well. Okay, awesome. I will go and install it in the bottom right. I think there's a setting for those with the slower uh internet connections. Download all then install, but it will install while downloading because we're in on Ethernet right now. And away it goes. Awesome. Yeah. And if that is covered in the video, um the options are pretty straightforward there. But it's Jamal had launched a web installer, so that's why it downloaded really fast. Now, it's actually going to go get all of the necessary pieces. Um and if you did decide to go the Visual Studio Code route, um I haven't done a comparison, but I think the installer is probably a smaller um package uh in in size overall. So, if you're concerned about that, maybe that's an option for you to to consider as well. Okay, awesome. So, while this installs, we're just gonna zoom ahead. Okay, Nick. And so, the second thing we're going to install is something called Git Extensions. That's right. Yeah. So, um for folks that are watching, um it's really a really popular source control system is called Git. Um there's many different ones, but Git is I would I I would argue is probably the most popular and widely used. Like I think even people that don't really program or don't have much um experience in the programming world, you've probably even heard of GitHub. Um maybe some people haven't, but um it's extremely popular. We're going to get git extensions today. Um instead of just the straight up command line git for a couple of reasons. One is that um even though I have been programming for like 20 years, I refuse to use command lines for things. I don't know why. I've just kind of gravitated towards uh user interfaces and I think especially when it comes to like helping navigate other people through stuff, having a user interface just is a lot easier than oh, you have a typo on this command and we're, you know, pulling our hair out. So, we're going to go ahead and get the the user interface called Git Extensions, which is just built around Git. So, I think you're going to want to look for the download link. Um, yeah, that MSI installer that's right there should be pretty good. All right. Can we install this while Visual Studio Community is installing? Um, good question. Um, if the Visual Studio installer itself is an MSI, it might not be happy about that. So, I think just to be safe, you have it downloaded. Uh, we should probably just wait for the installation to finish and then um that way we're not concerned about anything. Okay, good call. So, we'll be right back. All right, we're back. Visual Studio just finished installing. It keeps popping over to the other monitor. So, it's asking me to sign in. Uh there I am. I think it's already got me signed in because uh we did just install this and I uninstalled it because we want to be right um we want to show you guys right from the start. We just wanted to be safe that we weren't going to totally mess this up in the video. So, I think so far so good. So far so good. There's plenty to be done. So, Visual Studio 2022 Community is installed. So, before we go forward, Nick, should we get Git? That's right. Yeah, you're going to want to get extensions. Um, so it's great. The Visual Studios up there. All right. So, here we go. Opening it straight from the browser. All the installers are loving coming up on the other monitors. You see me drag them over. Uh, we've got some of the some other stuff on the screen here, so let's not distract you. All right, we're going to install Git Extensions. We're going to install for everyone. Yeah, this this is going to be a bit of a wizard to walk through. So, I think for a lot of the settings, you're probably going to just want to leave them as the defaults, but for anyone else going through this, um, you do want to take the time to consider what options you're picking. So, for example, if you're using a shared machine, like maybe you don't want to install it for everyone, but there's going to be a lot of basic stuff like that. and then some other things that might not make any sense to you to start with and picking the default is probably just a safer option to go with. So, um I think you're good here, Jamal. Just for next probably don't need to change that. Uh nothing that we really need to consider here. Um if you wanted to like trim down on some space, you could like maybe remove some docs or something, but it's keep going. Um this is up to you. If you want to share anonymous information about usage, I basically always opt out of these, but that's to each their own. Install. Way we go. It seems easy, but the next part is going to be that when it's actually installing Git, it's going to have some other options about the configuration for it. So, okay, a little bit of permissions. I'm not sure if the screen chopped out for that. Oh, it did. Yes, it did. Excellent. Very good. I thought that everything just exploded. So, it seems like we're actually safe. Okay, cool. All right, we're done. Well, that's interesting. I actually thought there was a lot more in the workflow for installing Git, but um I wonder if maybe you already have it installed or something on your computer perhaps. I do actually. I do have Git command line installed. This is an interesting one there. So, there's a lot of information on this screen and if you're not familiar with source control at all, this is something where you're going to be like, "What the heck are all these options?" Um, there's a lot of debate on, you know, which way to go here. I would honestly just leave it as the default for now. If you don't understand, for a brief note about what these options mean on a Windows machine, a line ending, and we don't often think about this. If if you're not used to coding, this is not something you think about. A new line on a Windows machine is going to be represented by two characters. And they are the characters uh that are a back slash R and a back slashn. So a carriage return and a line feed. Those are the names of those characters on a Linux machine or when it says Unix style, it's actually just backslashn. So just the line feed. There is no carriage return. So what ends up happening is when you're developing software across, you know, a Windows machine and you're using a Windowsbased text editor, you'll get a back slash rashn at the end of every line. anything you're using like if you're using Microsoft Word or something like that, you'll never see this this stuff because it's it's hidden from you. But that's how the characters are actually encoded. If you're using then Linux or Unix systems, you'll find that the characters are missing the back slash R because they don't use that for line endings. So when you're talking about source control, what gets really interesting is if you have people working on Unix systems and Windows systems contributing code to a common spot, you might find that someone goes and pulls down some code changes and they're like, "All my line endings are busted." And that's because these settings aren't configured properly. So I would generally just leave it. Um, and if you need to go like Google resources for this, there's lots of information about this stuff online, but we should be okay today. Okay, and it's installed. Let's get to the next step. Cool stuff. Okay. Okay, Nick. Uh, we've got everything installed. We're back. Hopefully, we're good to go this time. So, if you want to try going again and to get x clone, it's probably going to pop up some initial settings for you. Hopefully, this time it finds git. Nice. Um, here we go. Yeah, you can configure a username and email address. Um, you might want to do that um because you're going to want to make changes and then have that kind of tracked in the repository as well. This is my git username. So, it technically doesn't like it doesn't need to be exactly that, but uh I would personally just map to that. I would try to use your GitHub um username and email. All right, let's do that. It is probably blur all this. Maybe not. Or you guys might get the uncensored version. Okay. Um I think that's everything. Let's apply this. Be good. Yeah. Okay. Good. Repository will be cloned to new dictionary. Cdev subdirectory to create repository to clone. Okay. How do we find the repo? Right. So the next step that I'm going to recommend you do just so you can kind of see it visually on your side. If you want to go to github.com, I recommend that you try to clone this repository. So, I think there's an easy like user interface part where you can Oh, yeah. Right there. Cool. If you want to use HTTPS, so if you click that little tab and then just press copy, you should be able to paste that right into your git extension. All right, let's pop back over to this window. Here we are. Repo to clone. Okay, dev leader. Cde dev dev leader. What type of repo is this? This is a personal now because I'm bringing it on my own machine. Uh I would just go to personal repository. It's fine. Okay. Initialize all sub modules. Yeah, that's all good. Here we go. It's cloning. Oh, look at this. Perfect. Basically hacking into the main frame right now. As we we're already hacking into the main frame, everyone. Okay. And press okay. Cool. So you should at this point now have code here. You can see a dev leader folder. Nice, right? See how easy that was? That was relatively easy. Okay. I got a lot of stuff in here. Uh yeah, tonight. So, it's we don't need any of it really, but I just wanted to kind of have it organized this way so that you can add a new project into here, which is going to be our next step. So, um what you can just to get a little visual too, if you want to rightclick um somewhere here, not on a particular folder. Okay. So, we're going to go I'm going to unzoom a bit. Here we go. There you go. Yeah. If you go to get text open repository um in the context menu, what's really cool is now you'll get back to this visual. Um you can probably just uh uncheck that button that says check settings at startup. It'll save you a little bit of time. We'll we'll resolve all that later. It's just a couple of extra settings for you. But yeah, close that part. And hopefully you'll see a visual of the repository. Here you go. It's popped up. Let's bring this a little bit bigger. So, as you can see, like when I was talking about having a linear history, um you can see if you just move the scroll bar up and down, I probably don't have a single um like branch off of here. That doesn't mean that I don't haven't created branches. So, what happens here is that when you branch off, I can do that locally. And when I want to actually push my results to the mainline branch, in my case, this one is called master, I would basically take the commit from the other branch and bring it over. So it would be what's called a cherrypick. I'm not merging code back in and keeping merge commits. And that's why you won't see my other branches that exist. They're just on my computer. Okay. But okay, that's just some extra history there. So, just wanted to show you that's what the history of this repository looks like. So, that's pretty cool. That is what we want to do next is actually get over to the coding part and that's where it gets like more exciting. So, all right, you don't need um you can maybe put that in the background or close it. Um I always personally keep one of these open somewhere just so I can, you know, duck over to it and see what's up. Um but we're going to hop back over to Visual Studio now and we're going to make a whole new project and solution. Okay. So, since we cloned the repo, it's already on my machine. I'm going to open a local folder. Not quite. Um, damn. I know this is actually what you would do. I think in Visual Studio Code, it's more set up like this where you would go create a workspace, but because um I I kind of set you up here to like that's a I think the right thing to think about doing, but not in this case. and only because we don't need the other projects that are here. So, you don't need the whole workspace. We're just going to create a new one and create it into that workspace. So, sorry that I kind of set you up for uh for failure that one, but that's it was a good guess. It's a perfect example of what not to do and that's sometimes more important than what to do. So, I am going to take a second guess. Create a new project. That's right. Yeah. All right. We're dancing. All right, we got some spinny wheels here. I think the first time you go through it, it's probably going to take just a second to get all the templates and stuff. Um, and this is where we get to make our first kind of decision about some of the code we want to go write. So, I'm going to do a bit of a recap. I'll try to be brief on the last video on this. I was describing something where we would have um an application. It's probably going to start off as a console application. And this is just because uh in the beginning I don't think it's really useful for us to go building a user interface for our social media assistant yet. Um right now when we're trying to track um things like our you know our followers and how that's growing and everything right now we're just recording that into a spreadsheet and trending it. So, as a first step, I think we are okay with a console application still, but we're going to be talking about um you know, as we go through this, we'll talk about how we're going to split up this console application into multiple pieces. And then that way in the future, if we wanted to go put a front end on this that wasn't a console, our code is written in a way where we're we're set up for success there. We don't have to go, "Oh crap, let's go write it all from scratch." because we basically coupled all of this code to be working into a console. We'll we'll end up separating that out nicely. So, I think start with a console app and you should be able to press next. All right, sounds good. Console app is selected. Next. Well, the next uh yeah, most difficult thing in uh software development is coming up with names. And here you go is here's your first uh first foray into this. I'm gonna just take a hack at it and say social media assistant. Do you look, this is going to be a really good example of what I do in Excel, which is I'm going to guarantee is not correct because that's what GitHub is for. That's what Git is for. Uh version control, I would usually put V1 and that I assume is not what you want to do. Yeah. And that so it's a good thing to bring up in this particular case. Um, and if you get used to using source control effectively, you basically never have to think about naming stuff this way ever again. Um, great. I like that. I mean, it's all personal preference when it comes down to it, I guess. But ultimately, if you're comfortable with your source control, you like you can name your branches, you can tag things and give them a version, but you never need to name your projects and stuff like that. So, that's pretty cool. Okay. Um, there's going to be one small tweak I want us to make, and I don't usually do this, but because I I'm anticipating we're going to do this at some point. Anyway, I I want to change between the project name and the solution name, I would like the and I'll explain this in just a sec, but I want the solution name to remain as you've put, social media assistant, but I want the project name itself to be console after that. Socialist console. That's right. Okay. And with capital C. Um, so okay. So little so tell us is C# is very sensitive to our getting our capitals correct or is this just you can actually you could name it however you would like. You could use a lowercase C. You could be putting underscores between stuff. It's just not the convention that's used. Um, if you're using languages like Java, for example, um, you'll notice that when we're creating things, you'll have like methods that you call and they start with a lowercase letter. Java will not break if you use an uppercase letter. C will not break if you use a lowercase. It's just the the styling conventions in C are to be title case. Okay. All right. So, you'll notice though that the solution name itself also went to match if you just backspace the console part here. Perfect. I'm I'm trying to get you to do this and separate them because I anticipate that we will have at some other point another project inside of the solution. So I would like the solution to be named you know social media assistant as you've named it and then the first project within that will be the console application. At some other point we'll make another project and we'll split some of that code out and put it into there. Great. And that second project I imagine will be our our graphic user interface or guey. Yes. Yeah. So, and even even before we get to that, what we talked about in the previous video is like doing a plug-in system. So, we'll actually be able to demonstrate before even getting to a user interface, we'll be able to demonstrate that we can go build out these other smaller dedicated projects uh specifically for the social media platforms we're interested in. And then those will be some of the first projects. And then when we're ready, we can go make a user interface. Okay, awesome. Are we ready to press next or do we need to press okay? No, you're we're not worried about placing the solution and the project in the same directory. In this case, we actually don't want to. And that's because we anticipate having a like a multi- project structure inside the solution. So, you should be good to go. All right. Next. And the framework. What are we looking at? Oh, yeah. Let's use seven. We have it there. Here we go. Seven. Seven is the the new hotness. New do not use top level statements. Um yeah, so this is a a new feature. Um and actually I would use this as just leave it as the default. So just to briefly explain um especially for new people that aren't used to writing code, I think sometimes the very first program you write in C historically for net 7 can look a little bit intimidating. Uh, a lot of the time the first program you ever write is called hello world. It doesn't matter what language you're in. It's usually something called hello world and you're printing the text hello world to a console. And it's usually the most simple program you can write and gives you like a response like hey look something's actually happening. And previously, you would actually have more code on the screen to do hello world than you probably would think is necessary. So you'd have to like some of these might not even make sense if you're not familiar, but you'd need like a name space and you'd have like a a program class and then you'd have like a main function and then the one line that says uh console write line hello world. So you'd be like what the heck is all this? Now, you don't need any of it because uh I think at compile time um we can get into compilation stuff later, but at compile time with that one line, it will actually wrap what it needs to do and you don't ever have to think about it. All right, I'm going to and this whole time for everyone watching, I will be nodding like I understand everything Nick says. Hopefully, it starts to make more sense later. So, don't worry if you if it doesn't make sense, but uh hopefully it pies your interest and you hop in on Google and dig into some other uh material. Okay. So, we've selected leave comments for us, right? Like we can get back to you if you have questions as you're going. And Jamal, I anticipate that you'll have more questions and stuff as we go too. So, it's it's all good. The best way to learn, I think, is just by doing. You kind of strap in for a little bit. It's a little uncomfortable. And the the more comfortable you get with being uncomfortable, I think the the better you get at learning. So, right on. Okay. So, I've pressed create. My window has popped up. I'm about to drag it over. We got the spinning wheel. So, here we go. Um, my first look at VS Code or VS community. My mistake. Yeah. So, let's let's uh if you control mouse wheel, you can scroll in and make that text a little bit bigger for all of us. Here we go. We'll crank that up. All right. Um, if you recall what I was just saying, and it probably didn't make sense, maybe now it might make more sense. Aside from the very first line that's just a comment with the two slashes, your first program literally just says console right line hello world. Perfect. Before Before that other setting that we were just looking at, it would not be just this one line. It was like 10 lines of code that seemed completely unnecessary. but you had to have them for a C program to work. It just looks a lot cleaner now. So, that's all great. Um, as far as settings go, first question. Thank you. Uh, is there do we need to set anything up here on our on our uh development environment? No, I think you're actually done. So, if you want to prove it to yourself, go press the play button. All right. The play button is right here. Is there two play buttons? start without debugging and just this is the main one we want to do. They they currently will both do the same thing. You can configure them to do um like to run a different configuration. So Jamal, that is your very first program. Well, sorry, in C, I think. Not your in C#. It certainly is in C. uh like many that I've been probably watching um lots of Python. Hello world and uh and the like. So this is the debugging console. It popped up on the other screen for anyone that's watching and has two monitors. It probably did the same to you. And so I'm going to press any key to close this window. And away it goes. So yeah, we just got finished wrapping up installing the two tools that we think we're going to need for our development purposes. We ended up deciding to go with Visual Studio Community. And I mentioned earlier too that if you're more fond of Visual Studio Code, it's a great option. Um, I felt like working with Jamal, Visual Studio Community was going to be more obvious for me to help kind of guide him through that. Um, and the other thing is going to be git extensions. Again, you could opt for the command line Git. I prefer Git extensions just for the visuals and for the same reasons I just said about being able to kind of help guide someone through that. So, what are your thoughts on that, Jamal? It sounds good. I can't wait to get into the next part of this. Awesome stuff. So yeah, if you could do us a favor, like the video, leave a comment below if you had any thoughts, you got stuck along the way, uh try to help out. No problems there. And subscribe to the channel. You can start to see the rest of us uh the videos where we're creating the uh social media system. So thanks and we'll see you next time.

Frequently Asked Questions

What tools do I need to set up my environment for the Social Media Assistant project?

You'll need to install Visual Studio Community and Git Extensions. Visual Studio Community is a comprehensive IDE that will help us with our development, while Git Extensions provides a user-friendly interface for managing source control with Git.

Can I use Visual Studio Code instead of Visual Studio Community?

Yes, you can use Visual Studio Code if you prefer. It's a popular and free option, but for this project, I chose Visual Studio Community because I'm more familiar with it and can guide you more easily through the setup.

What should I do if I encounter issues during the installation process?

If you run into any problems, feel free to leave a comment on the video, and I'll do my best to help you out. It's all part of the learning process, and I'm here to support you!

These FAQs were generated by AI from the video transcript.
An error has occurred. This application may no longer respond until reloaded. Reload