You saved my bacon. I'm in a coding bootcamp situation, and the instructor just flew threw this. I managed to keep up at the time, but I couldn't later remember the way for projects to reference one another. Thanks!
I agree. Even though .NET 5 is out, learning how to set up projects in a solution and associating references to other classes was a mystery. The tutorials I found didn't explain how to do these things. Good job, Tim!
I have only been studying C# and using Visual Studio the past 2 weeks, but one thing I'd say Visual Code does well for a beginner who is willing to take a little extra step is at least partially disambiguate the "magic" of how C# programs work compared to the perhaps overly behind the scenes nature of Visual Studio. It allows you to use a powerful text editor for programming and IntelliSense, and also makes it so you can't rely on Visual Studio but instead set it up projects yourself. I've got a lot of learning, but this helped me get going in the right direction. Thanks
I've got very little experience with programming. Ive been trying to figure out how to get started creating something basic, I have not quite seen where this all leads, but as far as operating VScode, this is by far the best tutorial I have come accross. I can follow these steps to a T and get the same results. Fantastic. Thanks for your help
If you have not already, be sure to check out this video - ruclips.net/video/LUv20QxXjfw/видео.html It is intended to help you assess where you are and the topics you need to add to your base skills. We hope it will help you plan your personal journey. Tim's goal is to make becoming a developer easier and we hope we can help you be successful through your full journey!
THANK YOU! I've been tairing my hair out trying to sort all this nonsense out. New to C# DotNet, etc and the documentation really doesn't seem to cover this, which is NUTS but your video told me exactly what the problem was. I had no concept of a 'solution' and I still don't really understand what it is (meta project? workspace?) so this got me started, thanks! Subbed.
I am glad it was helpful. A solution is mainly just a "bucket" that keeps your projects together to make life easier. The solution doesn't actually connect the projects to each other. It just allows you to manage them together.
This video is brilliant. I was stuck with bunch of errors again and again , then i found this video uninstalled my apps , the follow your instructions and now everything is working well. Thanks so much
16:00 What`s supossed to be the right folder?!? I created a folder called VSCodeintro just like him ,but I got this message/error when i typed: dotnet new sln -n "VScodeintro": 'dotnet' is not recognized as an internal or external command, operable program or batch file. pleas help 🙏
this is definitely a missing intro for Visual Studio developers who may need to migrate to VSCode and understand how to do basic things within a solution, thank you!
Thanks so much for this, my crappy PC runs visual studio 2022 super slow, but vs code runs great, now I feel confident enough to use vs code without missing any visual studio features
@@IAmTimCorey Is there a way to add a frontend to a console app, I'm doing an assignment in a console app, I have to create a list of movies and videogames and display the titles, authors, seasons/hours and some more stuff, I have the console app ready, it works perfectly and displays everything in the terminal, I want to know if it is possible to link an html page and use css to style it and perhaps some JavaScript for animations, hope you can answer, thanks for your awesome Chanel bro! I've learned a lot!
Not really, but if you move your logic from the Console app over to a class library, and only do UI-focused work in the console (the actual WriteLine and ReadLine calls), you can then reference that class library from a web project UI and reuse all of your logic and data access code.
I am trying to change the path of my career. I am working on CFD for ten years and solving fluid dynamics equation systems using FORTRAN in Linux systems (yeah I know It sounds too old school). These C# videos are really clear and believe me that they make me feel like a passionate young engineer. Really really thank you.
Thank you @IAmTimCorey. Very informative and helpful video from the perspective of a Visual Studio Professional / C# user perspective switching to Visual Studio Code.
You mention toward the end to share any additional extension that one finds useful. One of my favorites is the "vscode-solution-explorer". This added yet another degree of familiarity to me versus the standard explorer.
I really appreciate this short and sweet video (sorry, I watched at 1.5 speed lol). Just now getting into C# and this helped tremendously. Great job explaining everything and making it all easy to comprehend
Hi Tim, i am fan of your in first Video only. i love to learn from you. so now onward i will watch all the your tutorial & i will fallow the VS Code learning. Thanks.
Thank you so much for the video. I really like VScode. I have Visual Studio Community, but I used VSCode to quickly run some Java code, and validate something. It gives you everything you need and the capability to install what you'll need later. I enjoy using it. I really like the Git support on it, and the fact that you can run it on machines you may not have admin access.
Nice video Tim! I've used VS Code for C# Development in the past(love the UI Design of it) but always find myself reverting to Visual Studio as my daily 'workhorse'. Both are great at the end of the day!
Yep, if you have the option, Visual Studio is a much more powerful option for developing C#. The benefit of VSCode is that it works on any platform, not just Windows.
it wont work for me. when i type in the dotnet solution thing, it pulls up "'dotnet' is not reconized as an internal or external command, operable program or batch file"
It sounds like you either do not have the .NET Core SDK installed or you do not have it properly on your PATH. Check first that it is installed and then check your PATH to be sure that there is a reference in there to the directory where the .NET Core SDK is installed.
Again, thank you so much, Tim. My company decided to not buy a VS license, so instead of installing the Community version and risking my job, I prefer to use VS Code and work exclusivity with console projects. Unfortunately, that's all I can afford right now.
in my C: i dont have Temp\VSCodeIntro when try find the temp folder in C -> user ->appdata -> local -> temp and create new folder VSCodeIntro. i cant do dotnet command :"(
That path is one I created on my machine. You have to create the path on your machine (the path does not have to be the same) and then you can follow along. The path will just be unique to you. As for not being able to do the dotnet command, it sounds like you might not have the .NET Core SDK installed. You can install the latest version here: dotnet.microsoft.com/download
btw you can use (shift + right-click) on in the folder window then select "Open PowerShell window here" then you can just create your project (dotnet new console -n test) and open it with code (code test) idk its faster for me c:
Uhm, I have a question. I'm following around 19:30 but, everytime I write "dir" it says "command not found", do you know why would that be? I also tried doing the code . to open visual code but it also says "command not found" like "-bash: Code:: command not found"
Ah, you are using bash, probably on Linux or Mac. You would do "ls" instead of dir. As for the "code ." not opening VSCode, it needs to be registered in your operating system. I'm not sure how you would do that in your OS.
33:34 Does anyone know how to make the bracket go to a new line when you press enter? I know Control + K + F will do this and you can do it on save, but immediately on enter would be nice.
Great tutorial, the best I've seen! I was left shaking my head at Microsoft's decision to not include a simple dialog box for creating new solutions like Visual Studio does. I was not surprised to see that someone has already written an extension called "vscode-solution-explorer" that brings that feature back. Having the command line as an option is great and I'm looking forward to seeing what I can do with the dotnet command, but going through that to just create a new solution is a repetitive task that I don't need to be wasting time on. The other features in VS Code make up for that one annoyance though. Do you know by chance if Microsoft is moving away from the solution/project model or was this just for VS Code?
VSCode wasn't designed for C#. In fact, VSCode is primarily designed as a text editor. It was designed to be extensible so that you can add support for C#, Python, Java, or practically anything else you want. The focus is on speed and extensibility so you can use it the way you want. Visual Studio is an Integrated Development Environment (IDE). It was designed for C# (and other .NET languages). The two applications have different goals. Microsoft is not shifting its focus.
I got an error "The SDK 'Microsoft.NET.Sdk' specified could not be found" when doing the command "dotnet sln VSCodeIntroSln.sln add ./IntroUI/IntroUI.csproj"
Nice intro. Everything worked exactly as you described, except that VS Code prompted me to install the .NET Core SDK (which it did, no problem). Glad you ended with a comparison of VS Code to Visual Studio for C#, and I was kind of wondering what the advantages to VS Code could possibly be with all that command-line stuff. Your breakdown was convincing. Would like to see this same kind of intro for Ruby and Python.
I got error that says "The type or namespace name 'IntroLibrary' could not be found (are you missing a using directive or an assembly reference?) [IntroUI]" When I tried to use PersonModel
when i try dotnet sln name.sln add **/* .csproj it gives me this Could not find project or directory `*/*`. Could not find project or directory `.csproj`. using windows poershell
Running through the video myself atm Assuming you ARE in the right directory. Try using 'Get-ChildItem' or 'dir' wrapped in parenthesis dotnet sln solution.sln add (gci *\*.csproj) dotnet sln solution.sln add (dir *\*.csproj) There could be more ways of expressing it but this worked for me.
How do you change the vscode launch settings to run multiple projects in the solution? I have an webapi project, a console worker, and a class lib used by both for common models, client abstractions, etc.
Hey up! I'm new to Visual Studio Code, as well as command line. When following you instructions, i keep getting the prompt that the usage of dotnet is reported , by my computer, as "not recognized as an internal or external command, operable program or batch file" .What's likely to be the problem? (I am using windows)
I switched to VSCode a week ago because I wanted to make a website for my family's business and was worried about the licensing on Visual Studio IDE. It's not as powerful as the IDE but its lightweight and speed and the extensions available more than compensate. I am using it for C#.NET and ASP.NET core and I am enjoying the experience. Here are two extensions that I find helpful: - ASP.NET Helper: This enables intellisense for razor pages. - C# XML Documentation comments. This auto generates an XML type comment when you type "///".
You shouldn't have a problem with VS licensing unless the family business is fairly large. You would have to be doing the work as a paid employee of the company and the company would need to make in excess of $1 million in revenue annually. Even then, there are cases where it is still ok to use Community Edition (which is free). I am glad you like VSCode though. Thanks for the plug-in suggestions.
You could run all of the same commands except the ones with wildcards (asterisks). In those cases, you will need to manually type out the path for each project. Since there are only two, this won't be a huge deal.
It sounds like you don't have the .NET Core SDK installed on your computer. You can get it here: dotnet.microsoft.com/download/dotnet/5.0 The latest version is .NET 5, which should work just fine for these examples.
I Hope the VSC have finally added some context menu for managing project but seems they leave this to VisualStudio :) Thank you for great tutorial. Cheers.
Hi, when I typed some code inside my C# method, the intellisense did not show any methods suggestions or when I click ctrl+, it doesn't show required namespaces, I tried restarting vscode on my windows laptop and I also tried restarting omnisharp but it still doesn't work. I was hoping if you can point me to the right direction on how to fix this issue?
Hi, I am beginner and completely new to C# moved from Cobol experience. When I run "dotnet run" - I get this error - error MSB4006: There is a circular dependency in the target dependency graph involving target "_GenerateRestoreProjectPathWalk". Please suggest Looks like missing some directive / reference as I see error line below System as well.
When you have two projects in a solution (let's say a web app and a class library), you cannot have each project reference the other. That is a circular dependency. The problem is that you need to compile one project before you can compile a project that depends on it. So, you actually need to remove a reference. The UI project should reference the class library. The class library should not reference the UI project.
When i type in dotnet new console it dont work anyone can help please ? it says : dotnet : The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pat h is correct and try again. At line:1 char:1 + dotnet new console + ~~~~~~ + CategoryInfo : ObjectNotFound: (dotnet:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException . PLEASE ANYONE CAN HELP ?
Hello, for some reason when I lauch Visual stuiod I with the "code ." command from within the "UI" directory the system isn't creating the Launch and Task Json files. Can you please tell me how to create these manually? FYI- I do get the ".vscode" folder Thanks
Well great tutorial man, but my VSCode refuses to create the launch/tasks json files.. No pop up comes along, no matter how much time I wait or from where I launch the program (solution or project level)? Any Ideas?
The Visual Studio IntelliCode extension for VS Code says it's for Python, TS/JS, and Java. C# users who need IntelliCode might have to go to full-fat Visual Studio (for Windows). Fortunately, the C# extension does claim to include IntelliSense (although that would lack the 'AI' of IntelliCode).
can I just make a folder on my desktop and put my code in there? just like Python. Im trying to make a game wondering if I have to add all these solutions and stuff to set it up every time. If you understand what I am saying.
Why did you make both an IntroUI folder and an IntroLibrary folder. Wouldn't it be fine to have the whole project in a folder called "Intro" and then structure the classes inside of here? Such as a model folder, network folder etc. and have the Program.cs class in the root of the Intro folder?
That was a software I had installed to help me handle my windows on a large screen. I forget the name (it might be in the comments because I think someone else asked this), but it isn't something that is needed anymore with Windows 10 and beyond.
@@IAmTimCorey I found a setting where you can make the window completely transparent but I like when the windows only turn semi-transparent. If you remember the setting that would be awesome!
I watched this, as I'm new to programming(hobby hopefully), I lost around 15 minutes because I didnt realise I needed to create an reference each direction of the .csproj files so they know of eachothers namespaces? I know you made it easier by a bash cmd line but I didnt have that and thought it was optional. Anyway, good little video, and it taught me a bit :)
One issue. When I try to debug it, I get an error on "Launch: Program 'C:\[File Path]\CSharpProj1\bin\Debug et5.0\CSharpProj1.dll' does not exist" despite the fact that there is a directory called "bin\HPD\Debug et5.0" with the file "CSharpProj1.dll" inside of it. Any ideas? Maybe it has to do with HPD whatever that means. Still very new to VSCode, so thank you for your tutorial. Also, importatnt to note that I have very recently installed the .NET 6.0, after the project files had been loaded, so perhaps that could be an issue as well. Thank you!
Time = 36:48 Can you please explain how you got VSCode to add the using statement for you? I have all the extensions you installed (and more). Thanks a lot in advance.
Normally we don't. We focus on the code we can change because that is most often where the issue lies. However, you can step into their code if you load their PDB files. I'm not sure of how to set that up in VSCode, though.
@@IAmTimCorey Ok thanks. I was afraid I would get this answer. I was hoping one symbols server existed that I was just unaware of, with all open source projects pdb available there, just like there is one for microsoft aspnetcore. Stepping into others code has been a necessity for me, documentation is sometimes lacking or minimal. You don't need to do that everyday of course, but I am sure you reached that point when you just can't find why the lib is behaving like it does, you tried to use a feature but it won't work in a particular case. Looking at the github repo is nice, but it is not always sufficient.
You saved my bacon. I'm in a coding bootcamp situation, and the instructor just flew threw this. I managed to keep up at the time, but I couldn't later remember the way for projects to reference one another. Thanks!
I am glad it was so helpful.
17:44 solution creation on the command line part
20:50 globbing pattern and adding .sln
39:00 nuget explanation
39:50 nuget
Thanks for sharing.
This is a fantastic intro to vscode in general, I learned so much from this I couldn't find anywhere else. Thank you
You are welcome.
I agree. Even though .NET 5 is out, learning how to set up projects in a solution and associating references to other classes was a mystery. The tutorials I found didn't explain how to do these things. Good job, Tim!
I have only been studying C# and using Visual Studio the past 2 weeks, but one thing I'd say Visual Code does well for a beginner who is willing to take a little extra step is at least partially disambiguate the "magic" of how C# programs work compared to the perhaps overly behind the scenes nature of Visual Studio. It allows you to use a powerful text editor for programming and IntelliSense, and also makes it so you can't rely on Visual Studio but instead set it up projects yourself. I've got a lot of learning, but this helped me get going in the right direction. Thanks
I am glad it was helpful.
I've got very little experience with programming. Ive been trying to figure out how to get started creating something basic, I have not quite seen where this all leads, but as far as operating VScode, this is by far the best tutorial I have come accross.
I can follow these steps to a T and get the same results.
Fantastic. Thanks for your help
If you have not already, be sure to check out this video - ruclips.net/video/LUv20QxXjfw/видео.html It is intended to help you assess where you are and the topics you need to add to your base skills. We hope it will help you plan your personal journey. Tim's goal is to make becoming a developer easier and we hope we can help you be successful through your full journey!
@@tomthelestaff-iamtimcorey7597 You are always great
DUDE! That cmd trick is amazing. Instant sub. Tysm.
Thanks!
THANK YOU! I've been tairing my hair out trying to sort all this nonsense out. New to C# DotNet, etc and the documentation really doesn't seem to cover this, which is NUTS but your video told me exactly what the problem was. I had no concept of a 'solution' and I still don't really understand what it is (meta project? workspace?) so this got me started, thanks! Subbed.
I am glad it was helpful. A solution is mainly just a "bucket" that keeps your projects together to make life easier. The solution doesn't actually connect the projects to each other. It just allows you to manage them together.
27:40 Time Saver: if you got Stuck while Debugging. Thanks a lot Tim you have covered everything.
You are welcome.
Arf, the first video with wich i succeeded in debug properly, many, many thanks
Excellent!
This video is brilliant. I was stuck with bunch of errors again and again , then i found this video uninstalled my apps , the follow your instructions and now everything is working well. Thanks so much
Thanks for building your skills with Tim.
16:00 What`s supossed to be the right folder?!? I created a folder called VSCodeintro just like him ,but I got this message/error when i typed: dotnet new sln -n "VScodeintro": 'dotnet' is not recognized as an internal or external command,
operable program or batch file.
pleas help
🙏
It sounds like you don't have the .NET Core SDK installed on your machine. Here is a link to install .NET 6: dotnet.microsoft.com/en-us/download
this is definitely a missing intro for Visual Studio developers who may need to migrate to VSCode and understand how to do basic things within a solution, thank you!
You are most welcome. Thanks for watching.
Thanks so much for this, my crappy PC runs visual studio 2022 super slow, but vs code runs great, now I feel confident enough to use vs code without missing any visual studio features
Glad I could help!
@@IAmTimCorey Is there a way to add a frontend to a console app, I'm doing an assignment in a console app, I have to create a list of movies and videogames and display the titles, authors, seasons/hours and some more stuff, I have the console app ready, it works perfectly and displays everything in the terminal, I want to know if it is possible to link an html page and use css to style it and perhaps some JavaScript for animations, hope you can answer, thanks for your awesome Chanel bro! I've learned a lot!
Not really, but if you move your logic from the Console app over to a class library, and only do UI-focused work in the console (the actual WriteLine and ReadLine calls), you can then reference that class library from a web project UI and reuse all of your logic and data access code.
@@IAmTimCorey I'll definitely check that out!
This is the very best intro on C# projects for VSCode. Thanks!!
You are welcome.
thanks Tim. It was very clear. I will keep coming back to you.
You are welcome.
I am trying to change the path of my career. I am working on CFD for ten years and solving fluid dynamics equation systems using FORTRAN in Linux systems (yeah I know It sounds too old school). These C# videos are really clear and believe me that they make me feel like a passionate young engineer. Really really thank you.
Fantastic! That is great to hear.
Thank you @IAmTimCorey. Very informative and helpful video from the perspective of a Visual Studio Professional / C# user perspective switching to Visual Studio Code.
You mention toward the end to share any additional extension that one finds useful. One of my favorites is the "vscode-solution-explorer". This added yet another degree of familiarity to me versus the standard explorer.
Thanks for sharing.
I really appreciate this short and sweet video (sorry, I watched at 1.5 speed lol). Just now getting into C# and this helped tremendously. Great job explaining everything and making it all easy to comprehend
I am glad it was so helpful.
I don't know why I was sure that sln was not possible to use with vs code. Thank you for showing me that vs code is indeed a real usable tool
I am glad it was helpful.
Hi Tim, i am fan of your in first Video only. i love to learn from you. so now onward i will watch all the your tutorial & i will fallow the VS Code learning. Thanks.
Welcome aboard!
Thank you so much for the video. I really like VScode. I have Visual Studio Community, but I used VSCode to quickly run some Java code, and validate something. It gives you everything you need and the capability to install what you'll need later. I enjoy using it. I really like the Git support on it, and the fact that you can run it on machines you may not have admin access.
Yep, it is pretty powerful.
Thank you Tim so much for taking the time out of your day to teach us how to setup VSCode for C#.
You are welcome.
Great intro to start use VS Code - really saving some time for those simple things you need to know to start! Thank you Tim :)
I wish everything came with an intro video like this.
Great tutorial. Your videos always are a great place to learn coding-related stuff.
Thank you!
Brilliant!! So simple and easy to understand for beginners!!
Great!
This video explains everything so clearly, thanks so much!
Glad it was helpful!
waw, nice intro for a newcomer like me
and so easy to get it
nice work dude!!
Thanks!
Thank you for sharing your knowledge, that video it's essential for start programming into vscode...
Thanks for the endorsement
Thanks really nice one. Solved my issue of shifting from Visual studio IDE to Visual Code.
Glad it helped!
Nice video Tim! I've used VS Code for C# Development in the past(love the UI Design of it) but always find myself reverting to Visual Studio as my daily 'workhorse'. Both are great at the end of the day!
Yep, if you have the option, Visual Studio is a much more powerful option for developing C#. The benefit of VSCode is that it works on any platform, not just Windows.
this is EXACTLY what I need!
subbed
Great!
I was out in the wilderness until this video. Thankyou!
I am glad it was helpful.
it wont work for me. when i type in the dotnet solution thing, it pulls up "'dotnet' is not reconized as an internal or external command, operable program or batch file"
It sounds like you either do not have the .NET Core SDK installed or you do not have it properly on your PATH. Check first that it is installed and then check your PATH to be sure that there is a reference in there to the directory where the .NET Core SDK is installed.
Can you be mor clear i have only done scratch programming
@@IAmTimCorey ok now i know how to do it
Thank you for taking the time to produce this helpful video.
You are welcome.
You sir, definitely deserve a lot more subscribers.
Thank you!
Thanks a lot, was very interesting explanation, I learned something new this day, and I am happy.
Excellent!
Thank you so much for sharing this kind of content, I am very impressed about the all things that VS Code can do
You are welcome.
This is just a superb tutorial...I wish my professor was this clear...thank you so much!
You are welcome.
Very nice tutorial Tim. Was exactly looking for something like this.
Glad it was helpful!
your training videos are very helpful for my development
Glad to hear that!
Again, thank you so much, Tim. My company decided to not buy a VS license, so instead of installing the Community version and risking my job, I prefer to use VS Code and work exclusivity with console projects. Unfortunately, that's all I can afford right now.
18:15
'dotnet' is not recognized as an internal or external command, operable program or batch file.
What do I do? Yes I am a total beginner lol.
Download the .NET 6 or .NET 7 SDK (not .NET 8 yet - it is in preview) from here: dotnet.microsoft.com/en-us/download/visual-studio-sdks
Thank you so much! I was getting a little lost using C# with VS Code.
Glad it helped!
in my C: i dont have Temp\VSCodeIntro
when try find the temp folder in C -> user ->appdata -> local -> temp and create new folder VSCodeIntro. i cant do dotnet command :"(
That path is one I created on my machine. You have to create the path on your machine (the path does not have to be the same) and then you can follow along. The path will just be unique to you. As for not being able to do the dotnet command, it sounds like you might not have the .NET Core SDK installed. You can install the latest version here: dotnet.microsoft.com/download
@@IAmTimCorey Thanks Tim
btw you can use (shift + right-click) on in the folder window then select "Open PowerShell window here"
then you can just create your project (dotnet new console -n test)
and open it with code (code test)
idk its faster for me c:
Thanks for sharing!
This was exactly what I needed , thank you!
Glad you found the help you needed within Tim's videos
Please help me i cant find the vscodeintro folder to open cmd in
I created that folder. You can do the demo in any folder you want.
@@IAmTimCorey oh thank you so much
Uhm, I have a question. I'm following around 19:30 but, everytime I write "dir" it says "command not found", do you know why would that be?
I also tried doing the code . to open visual code but it also says "command not found" like "-bash: Code:: command not found"
Ah, you are using bash, probably on Linux or Mac. You would do "ls" instead of dir. As for the "code ." not opening VSCode, it needs to be registered in your operating system. I'm not sure how you would do that in your OS.
Thank you so much for this helpful video! I'm loving VS Code.
You're very welcome!
thank you Tim, you really gave me what I needed to kick start.
Great to hear!
33:34 Does anyone know how to make the bracket go to a new line when you press enter? I know Control + K + F will do this and you can do it on save, but immediately on enter would be nice.
Not sure, sorry.
Great video, so descriptive and step by step.
Thank you!
Great tutorial, the best I've seen! I was left shaking my head at Microsoft's decision to not include a simple dialog box for creating new solutions like Visual Studio does. I was not surprised to see that someone has already written an extension called "vscode-solution-explorer" that brings that feature back. Having the command line as an option is great and I'm looking forward to seeing what I can do with the dotnet command, but going through that to just create a new solution is a repetitive task that I don't need to be wasting time on. The other features in VS Code make up for that one annoyance though. Do you know by chance if Microsoft is moving away from the solution/project model or was this just for VS Code?
VSCode wasn't designed for C#. In fact, VSCode is primarily designed as a text editor. It was designed to be extensible so that you can add support for C#, Python, Java, or practically anything else you want. The focus is on speed and extensibility so you can use it the way you want. Visual Studio is an Integrated Development Environment (IDE). It was designed for C# (and other .NET languages). The two applications have different goals. Microsoft is not shifting its focus.
@@IAmTimCorey Thanks!
I got an error "The SDK 'Microsoft.NET.Sdk' specified could not be found" when doing the command "dotnet sln VSCodeIntroSln.sln add ./IntroUI/IntroUI.csproj"
This post should help: stackoverflow.com/q/46257393/733798
@@IAmTimCorey It worked thanks
Tim you are a hero! Thanks
You are welcome.
Nice intro. Everything worked exactly as you described, except that VS Code prompted me to install the .NET Core SDK (which it did, no problem). Glad you ended with a comparison of VS Code to Visual Studio for C#, and I was kind of wondering what the advantages to VS Code could possibly be with all that command-line stuff. Your breakdown was convincing. Would like to see this same kind of intro for Ruby and Python.
Ruby and Python are outside of my skill set (I know enough to be dangerous, not enough to teach them) but I'm glad you enjoyed my video.
I got error that says "The type or namespace name 'IntroLibrary' could not be found (are you missing a using directive or an assembly reference?) [IntroUI]" When I tried to use PersonModel
Did you add the reference to the library? Did you add the using statement for the library?
IAmTimCorey Yes, I did add reference to the library and use statement for that library...
Hi. the system says, there is no such type or class "PersonModel"". Could you please advsie how to resolve this?
It sounds like you are missing a using statement at the top.
@@IAmTimCorey have statements in the top, but cannot resolve, trying to do it 2 days already. Nothing works
What should I do if the pop up " Require access to the " does not display?
I do not get this message pop up too...
Super clear explanation
Thanks!
18:10 does not works for me (( It says that: 'dotnet' is not recognized as an internal or external command ... Is there any pill to fix it? Thanks
Check to be sure that you have the latest version of the .NET Core SDK installed on your machine.
when i try dotnet sln name.sln add **/* .csproj
it gives me this
Could not find project or directory `*/*`.
Could not find project or directory `.csproj`.
using windows poershell
It sounds like you might not be in the correct directory.
Running through the video myself atm
Assuming you ARE in the right directory. Try using 'Get-ChildItem' or 'dir' wrapped in parenthesis
dotnet sln solution.sln add (gci *\*.csproj)
dotnet sln solution.sln add (dir *\*.csproj)
There could be more ways of expressing it but this worked for me.
How do you change the vscode launch settings to run multiple projects in the solution? I have an webapi project, a console worker, and a class lib used by both for common models, client abstractions, etc.
Hey up! I'm new to Visual Studio Code, as well as command line. When following you instructions, i keep getting the prompt that the usage of dotnet is reported , by my computer, as "not recognized as an internal or external command, operable program or batch file" .What's likely to be the problem? (I am using windows)
Fantastic video have learnt a lot
Thanks for watching, Roger
I switched to VSCode a week ago because I wanted to make a website for my family's business and was worried about the licensing on Visual Studio IDE. It's not as powerful as the IDE but its lightweight and speed and the extensions available more than compensate. I am using it for C#.NET and ASP.NET core and I am enjoying the experience.
Here are two extensions that I find helpful:
- ASP.NET Helper: This enables intellisense for razor pages.
- C# XML Documentation comments. This auto generates an XML type comment when you type "///".
You shouldn't have a problem with VS licensing unless the family business is fairly large. You would have to be doing the work as a paid employee of the company and the company would need to make in excess of $1 million in revenue annually. Even then, there are cases where it is still ok to use Community Edition (which is free). I am glad you like VSCode though. Thanks for the plug-in suggestions.
I tried to make a number guess game but it woud only display "Guess a number 1-100" entering numbers into the debug console does nothing.
Sounds like you have some debugging work to do. Use breakpoints to track down the issue.
@@IAmTimCorey Actually, the program works fine if you run it with the terminal.
Hi
i am using office pc
in that installation of BASH not possible
can u able to share command in CMD instead of bash
Which commands are you referring to (time code)? The commands are typically very close to the same.
@@IAmTimCorey Hi
21:53 Adding project to solution : Bash prompt
You could run all of the same commands except the ones with wildcards (asterisks). In those cases, you will need to manually type out the path for each project. Since there are only two, this won't be a huge deal.
'dotnet' is not recognized as an internal or external command,
operable program or batch file.
You need to have the .NET sdk installed.
Thank you I have installed and it worked.
its show dotnet is not recognized as an internal or external command, operable program or batch file what to do.
It sounds like you don't have the .NET Core SDK installed on your computer. You can get it here: dotnet.microsoft.com/download/dotnet/5.0
The latest version is .NET 5, which should work just fine for these examples.
@@IAmTimCoreynow I solve my problem anyway thanks
the information is really good, thanks for the video
I do have to nitpick however, im watching at x2.0 speed and still feels slow
but great video
I can only talk so fast when I'm also trying to think ahead and type. It is a limitation of my brain.
I Hope the VSC have finally added some context menu for managing project but seems they leave this to VisualStudio :)
Thank you for great tutorial. Cheers.
This is what I was looking for!
Great!
Thank you very much for the tutorial. It helped me a lot.
You're welcome!
Hi, when I typed some code inside my C# method, the intellisense did not show any methods suggestions or when I click ctrl+, it doesn't show required namespaces, I tried restarting vscode on my windows laptop and I also tried restarting omnisharp but it still doesn't work. I was hoping if you can point me to the right direction on how to fix this issue?
VSCode can be tricky. Intellisense might be still trying to load or it might be having an issue.
Hi, I am beginner and completely new to C# moved from Cobol experience. When I run "dotnet run" - I get this error - error MSB4006: There is a circular dependency in the target dependency graph involving target "_GenerateRestoreProjectPathWalk". Please suggest
Looks like missing some directive / reference as I see error line below System as well.
When you have two projects in a solution (let's say a web app and a class library), you cannot have each project reference the other. That is a circular dependency. The problem is that you need to compile one project before you can compile a project that depends on it. So, you actually need to remove a reference. The UI project should reference the class library. The class library should not reference the UI project.
@@IAmTimCorey Thanks a lot for your kind reply
hi. can we use elmah in vscode? i tried elmahcore but app.useElmah() wont work.
Yes, it has nothing to do with VSCode. VSCode is just the editor. It does not change how your code is run.
When I try to CTRL+ . to add the using statement for the IntroLib, it does not recognize it. Any thoughts?
VSCode isn't as powerful as Visual Studio. It may not be seeing that IntroLib exists or it may not have updated its cache of information yet.
IAmTimCorey it had not created the csproj file. It was referenced but not created. Thank you!
Firstly thanks for amazing explanations, secondly it would be great if you make a video about Blazor localization.
I will add it to the list. Thanks for the suggestion.
When i type in dotnet new console it dont work anyone can help please ? it says : dotnet : The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the pat
h is correct and try again.
At line:1 char:1
+ dotnet new console
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (dotnet:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException . PLEASE ANYONE CAN HELP ?
It sounds like you don't have the .NET Core SDK installed on your machine: dotnet.microsoft.com/download
Hello, for some reason when I lauch Visual stuiod I with the "code ." command from within the "UI" directory the system isn't creating the Launch and Task Json files. Can you please tell me how to create these manually? FYI- I do get the ".vscode" folder Thanks
I think you want to open it one level higher at the solution level.
@@IAmTimCorey Perfect! thanks!
25:56
I didn't got that message thing or the folder either
22:00 Tim Corey: "this is not the command prompt, this is bash, it's different"
Also Tim Corey: runs dir in bash 🤦♂️
lol yeah, it may be bash but I’ve spent my whole life on the command prompt (started in DOS) so I forget and fall back to those commands a lot.
get-childitem
a video from 2019 and you can't use the GUI to create a solution file??
dir i mean dur
@@andrewshearer4965 cmd/bash is way lighter and quicker
Well great tutorial man, but my VSCode refuses to create the launch/tasks json files..
No pop up comes along, no matter how much time I wait or from where I launch the program (solution or project level)? Any Ideas?
When I go on variables i cant see any of the variables, i see the dropdown menu but no variables, why is that
The Visual Studio IntelliCode extension for VS Code says it's for Python, TS/JS, and Java. C# users who need IntelliCode might have to go to full-fat Visual Studio (for Windows). Fortunately, the C# extension does claim to include IntelliSense (although that would lack the 'AI' of IntelliCode).
can I just make a folder on my desktop and put my code in there? just like Python. Im trying to make a game wondering if I have to add all these solutions and stuff to set it up every time. If you understand what I am saying.
The solution and project files are important for C#. C# isn't structured the same as Python.
The docker extension is awesome
It really is.
Why did you make both an IntroUI folder and an IntroLibrary folder. Wouldn't it be fine to have the whole project in a folder called "Intro" and then structure the classes inside of here? Such as a model folder, network folder etc. and have the Program.cs class in the root of the Intro folder?
When you click and drag one your windows it becomes semi-transparent. How did you do this?
That was a software I had installed to help me handle my windows on a large screen. I forget the name (it might be in the comments because I think someone else asked this), but it isn't something that is needed anymore with Windows 10 and beyond.
@@IAmTimCorey I found a setting where you can make the window completely transparent but I like when the windows only turn semi-transparent. If you remember the setting that would be awesome!
Could you explain how to add a reference to a local dll (for an API)?
I will add it to the list. Thanks for the suggestion.
Does anyone know how to debug NuGet packages? - I'm having trouble finding instructions on how to step into that code from my main project!
I watched this, as I'm new to programming(hobby hopefully), I lost around 15 minutes because I didnt realise I needed to create an reference each direction of the .csproj files so they know of eachothers namespaces? I know you made it easier by a bash cmd line but I didnt have that and thought it was optional. Anyway, good little video, and it taught me a bit :)
You shouldn't be creating a reference to the user interface from the class library.
Very helpful video, thanks a lot!
Glad it was helpful!
THANKS A LOT I wanted this tutorial so much!
You are welcome.
One issue. When I try to debug it, I get an error on "Launch: Program 'C:\[File Path]\CSharpProj1\bin\Debug
et5.0\CSharpProj1.dll' does not exist" despite the fact that there is a directory called "bin\HPD\Debug
et5.0" with the file "CSharpProj1.dll" inside of it. Any ideas? Maybe it has to do with HPD whatever that means. Still very new to VSCode, so thank you for your tutorial. Also, importatnt to note that I have very recently installed the .NET 6.0, after the project files had been loaded, so perhaps that could be an issue as well. Thank you!
I can't seem to debug when expecting a user input using Console.ReadLine
Time = 36:48
Can you please explain how you got VSCode to add the using statement for you?
I have all the extensions you installed (and more).
Thanks a lot in advance.
How do you debug / step into third party lib like Dapper, Serilog, IdentityServer, Npgsql etc. ?
Normally we don't. We focus on the code we can change because that is most often where the issue lies. However, you can step into their code if you load their PDB files. I'm not sure of how to set that up in VSCode, though.
@@IAmTimCorey Ok thanks. I was afraid I would get this answer. I was hoping one symbols server existed that I was just unaware of, with all open source projects pdb available there, just like there is one for microsoft aspnetcore.
Stepping into others code has been a necessity for me, documentation is sometimes lacking or minimal. You don't need to do that everyday of course, but I am sure you reached that point when you just can't find why the lib is behaving like it does, you tried to use a feature but it won't work in a particular case. Looking at the github repo is nice, but it is not always sufficient.
Thanks man, It was really helpful.
Glad to hear it!