Intro To The .NET CLI - How To Use It, Why We Need It, And More

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ธ.ค. 2024
  • .NET has a set of command-line tools that are excellent. You can create, update, build, and publish an application all from the command line, and that is just scratching the surface of what it can do. In this video, we are going to look at how to use the command line as well as why it exists and when we would take advantage of it.
    Full Training Courses: IAmTimCorey.com
    Source Code: leadmagnets.ap...
    Mailing List: signup.iamtimc...
    .NET SDK Downloads: dotnet.microso...
    Runtime Identifier Catalog: docs.microsoft...

ความคิดเห็น • 124

  • @biskitpagla
    @biskitpagla 2 ปีที่แล้ว +21

    I absolutely love your approach to teaching. It's not just that your videos are in-depth, the amount of effort you put into picking topics to cover that are actually helpful is also very admirable.

  • @pierreplourde
    @pierreplourde 2 ปีที่แล้ว +7

    This is very cool! Too many people discount CLI because it seems complicated or seems to require esoteric knowledge/memorization, but as someone who grew up in the era of the Commodore VIC-20, I appreciate how much closer to the machine the CLI can put me.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Thanks for sharing.

  • @stepbackandthink
    @stepbackandthink ปีที่แล้ว +2

    I've looked at training videos from several sources recently and you are easily the best coach by some distance.

  • @haxguy0
    @haxguy0 2 ปีที่แล้ว +4

    Wow this was amazing! I was looking for content on this topic for hours. Clear, to the point, detailed. I'll definitely look up your courses. Thank you

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad it was so helpful.

  • @Fred_Edx
    @Fred_Edx ปีที่แล้ว +2

    This is absolutely wonderful. To find something like this that makes development easier.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      I’m glad it is helpful.

  • @simon-white
    @simon-white ปีที่แล้ว +1

    Great overview video Tim, makes it easy to pick up. Had an explore and found you can run everything from the sln folder (C:\temp\CliDemo) as long as you specify the project paths (don't even need the whole path, just the folder name)
    e.g. dotnet add DemoLib package Dapper; dotnet add DemoApp reference DemoLib; dotnet run --project DemoApp; dotnet publish DemoApp -p:PublishSingleFile=true etc.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Yep, it just takes more typing.

    • @simon-white
      @simon-white ปีที่แล้ว

      @@IAmTimCorey it's not so bad with tab completion for the paths but I agree for interactive use. I think it makes most sense for scripting. Personal preference I guess, I'd rather a script not need to depend on changing directory from its starting point.

  • @jayadeshchristo2345
    @jayadeshchristo2345 ปีที่แล้ว

    Loved this . Will watch more of your videos ...

  • @OnlyBESTClub
    @OnlyBESTClub 2 ปีที่แล้ว

    I've the courage to open solution and project files now. Thank you!

  • @Slider1604
    @Slider1604 2 ปีที่แล้ว

    Excellent Video! Thanks. Just in time. I'm about to get serious about the dotnet CLI. Thank you.

  • @willian-rattis
    @willian-rattis 2 ปีที่แล้ว

    Amazing, I was able to understand your English perfectly, it's an amazing class, tks 🇧🇷

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Happy to hear that!

  • @michelchaghoury9629
    @michelchaghoury9629 2 ปีที่แล้ว +6

    Great content will you be making vids about microservices and testing, you already did and covered about testing but i would like to see how e2e and specflow testing is done

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

    • @aniljha6106
      @aniljha6106 2 ปีที่แล้ว

      I have already added microservices in suggestions site . Still waiting for the video

  • @axmart1993
    @axmart1993 2 ปีที่แล้ว

    Can't wait for the raspbery pi video, i thinking about buying one for a long time.

  • @Indasaid
    @Indasaid 2 ปีที่แล้ว

    Excellent video Tim, Thanks! Showed me exactly what I needed 👍🏼

  • @claudiocespon4128
    @claudiocespon4128 2 ปีที่แล้ว

    Excellent as always! Thanks a lot Tim!

  • @user-ce8lo9ir6t
    @user-ce8lo9ir6t 2 ปีที่แล้ว

    Your Content is always top notch man!!

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Thanks!

    • @user-ce8lo9ir6t
      @user-ce8lo9ir6t 2 ปีที่แล้ว +1

      @@IAmTimCorey I was joking 😃😃... Sorry just kidding....your content really is top

  • @pwnuser2940
    @pwnuser2940 2 ปีที่แล้ว +2

    Hello, Tim.
    I appreciate you for all the tutorials you did and for sharing knowledge with us, I learned a lot from you, even more than what the university teaches me.
    Could you make in the near future, a video about how we can find the solution to certain tasks/problems? By what set of steps should I think about the solution? I often copy code from several places and manage to do what I propose, or either follow tutorials that implement the feature, but I would like and it would help me to think by myself and come up with my own solutions.
    Thanks a lot!

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      A lot of that comes from practice. The more you practice planning, the better you will become at it.

    • @mattongbp
      @mattongbp 2 ปีที่แล้ว

      lol...University are KILLERS of innovation. Robots maker.

  • @VivekGawande1
    @VivekGawande1 6 หลายเดือนก่อน

    It would have been great if you also covered configaration and launchsettings. Great video!

    • @IAmTimCorey
      @IAmTimCorey  6 หลายเดือนก่อน

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @billcarpenter5615
    @billcarpenter5615 ปีที่แล้ว

    Thanks so much for this video, I have been wanting to get vs code working to create programs on a linux box and this helped me get that working.

  • @andergarcia1115
    @andergarcia1115 ปีที่แล้ว

    Master, you have become an idol for me

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      I'm glad you find the content helpful.

  • @RubenALopes
    @RubenALopes ปีที่แล้ว

    This is really helpful! Thanks Tim

  • @guillermodanielmazzarigiov1768
    @guillermodanielmazzarigiov1768 2 ปีที่แล้ว

    Thanks bro! Awesome one! Extremely useful, at least for me

  • @banisan2035
    @banisan2035 ปีที่แล้ว

    Thank you my friend. Your videos are lovely. c:

  • @programmingmadeclear
    @programmingmadeclear 2 ปีที่แล้ว

    Another great video from great Tim 👌

  • @uppercat7268
    @uppercat7268 2 ปีที่แล้ว

    Great video as always.

  • @michaelparker6907
    @michaelparker6907 ปีที่แล้ว

    This clears up a lot of territory. Much to build on here.

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      I am glad it was helpful.

  • @alejandromachacanavia8036
    @alejandromachacanavia8036 ปีที่แล้ว

    Really interesting, thank you!

  • @kahongchow8746
    @kahongchow8746 28 วันที่ผ่านมา

    Thanks!

    • @IAmTimCorey
      @IAmTimCorey  28 วันที่ผ่านมา

      Thank you!

  • @civilsavant6072
    @civilsavant6072 2 ปีที่แล้ว +1

    Thanks for this great video. I wasn't able to get this to work, maybe you can help me understand why? I am trying to learn the Stride game engine (C# based). The only way they give you to create a release build is through VS, which I can't run, so I am trying to do it from command prompt. I have changed directory to where the .sln file is and tried to use dotnet build/build -c Release/publish(not wirtten this way, it was written out properly in command prompt for each type). It keeps saying " Unable to find a project to restore!", but then immediately afterward it prints the path and name of the the .sln file. No builds have been created. Do you know how to make this work?

    • @civilsavant6072
      @civilsavant6072 2 ปีที่แล้ว

      The exact commands I entered were these:
      dotnet build
      dotnet build -c Release
      dotnet publish -p:PublishSingleFile=true -r win-x64 --self-contained true

  • @martyna9001
    @martyna9001 ปีที่แล้ว

    I really enjoyed your explanation thank you !

  • @llamadrama169
    @llamadrama169 2 หลายเดือนก่อน

    Great video, thanks!

    • @IAmTimCorey
      @IAmTimCorey  2 หลายเดือนก่อน

      You're welcome!

  • @mashpayne
    @mashpayne ปีที่แล้ว

    Thanks Cory, it was really helpful. You can tell a video tutorial is useful when you don't get bored or feeling lost. Great video.
    I am trying to use CLI to publish MAUI app (android/iOS/windows). Do you know know tutorial for that?

  • @quince10
    @quince10 2 ปีที่แล้ว

    Thank you! So helpful!!

  • @00wiking
    @00wiking 2 ปีที่แล้ว

    On Linux I use cli all the time but always nice to watch and maybe learn something new :)

  • @laszloszoke18
    @laszloszoke18 ปีที่แล้ว

    What I learned from this video is that before every command, you have to enter a 'cls' command.

  • @ramanareddybuchepalli6844
    @ramanareddybuchepalli6844 2 ปีที่แล้ว

    Hi @IAmTimCorey,how we can figure out which build tool used Ms build or .net cli to build .csproj

  • @hwd1978
    @hwd1978 2 ปีที่แล้ว

    Thank you Tim. How to add an item (C# class) into the C# project?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Just put it in the folder where the csproj file is or in a subfolder of that main folder. That's it.

    • @hwd1978
      @hwd1978 2 ปีที่แล้ว

      @@IAmTimCorey Thank you!

  • @cadamsmith
    @cadamsmith 2 ปีที่แล้ว +1

    excellent video

  • @shivaakrish
    @shivaakrish 2 ปีที่แล้ว

    awesome tutorial. thank you.

  • @sakalansnow6579
    @sakalansnow6579 2 ปีที่แล้ว

    Amazing job 👍

  • @darrendickerson512
    @darrendickerson512 6 หลายเดือนก่อน

    Hi Tim, Hope you are well! When I do dotnet run on a rest api project I get a "ctrl-x" to end even if I just run the app from the prompt. I'm on macos btw. Where do I go to find info on how to get around that in a cicd jenkins pipeline. I have some postman newman test I want to run. Thanks, Darren

    • @darrendickerson512
      @darrendickerson512 5 หลายเดือนก่อน

      So it is just "dotnet run > /dev/null &" on a mac... lol

  • @kurthill4
    @kurthill4 ปีที่แล้ว

    Hi Tim -- your videos are awesome, thanks so much for publishing these! Quick question - I have followed along in this video and everything seems to work, but when I do the publish to a single file step, I get mostly the same output you get, however I get an error that says "publishing to a single file is only supported for executable apps" when it is chewing on DemoLib. It does not spit up an error for DemoApp. The resulting app seems to work fine... I am curious as to why you do not get that error in your video?

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      You don't publish the class library. Only UI projects can be published this way.

  • @kakhatezelashvili3368
    @kakhatezelashvili3368 2 ปีที่แล้ว

    Thanks for the great video. But I am a little confused, what is the difference between dotnet build and dotnet publish commands ?
    Since we can also grab the output of the dotnet build command and put it somewhere ?
    Also I see that after running dotnet publish command, we see the same exact output as build command produces ?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      This answer will help: stackoverflow.com/a/55959286/733798
      Basically, publish actually prepares your application to move. Build doesn't, so while it can sometimes work, it won't always.

  • @pylvr8021
    @pylvr8021 2 ปีที่แล้ว

    Great as always thanks you sir :) quick question any plans for graphql tutorial ?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @narendrababu176
    @narendrababu176 2 ปีที่แล้ว

    Nice to know this concept. Thanks Tim.
    Also, your content, explanation is superb. Could you please make sure the text will be clearly visible. It is shady and blur, not clear to note down the points quickly...

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I would recommend checking your video playback settings. This was recorded in 1080p, and the text is crisp and clear.

  • @oskarisulkakoski3677
    @oskarisulkakoski3677 10 หลายเดือนก่อน

    Thank you!

    • @IAmTimCorey
      @IAmTimCorey  10 หลายเดือนก่อน

      You're welcome!

  • @Patrick-cu5kb
    @Patrick-cu5kb 2 ปีที่แล้ว

    Can you make another video using the mvc project and watch mode that comes with?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @jacool5168
    @jacool5168 2 ปีที่แล้ว

    Hi Tim. I have problem with one commend on Linux:
    dotnet publish -p:PublishSingleFile=true -r linux-x64 -self-contained true
    I get :
    MSBuild: error MSB1008: Only one project can be specifed

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Are you running this in the directory of your project? It won’t work if it is the solution directory or if there are multiple projects in the directory.

    • @jacool5168
      @jacool5168 2 ปีที่แล้ว

      @@IAmTimCorey I am running on linux in VirtualBox, on windows evrything is allright. I have one project.

  • @TheBausahab
    @TheBausahab 2 ปีที่แล้ว

    thank you sir...

  • @christophem6373
    @christophem6373 2 ปีที่แล้ว +2

    Could you chapterize please ?

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +2

      Chapters come from my viewers. I don't have the time to go back through and add chapters, but if a viewer wants to contribute chapters in the comments, I will add them to the description.

  • @S3Kglitches
    @S3Kglitches 2 ปีที่แล้ว

    Could you show how to debug using .pdb on a published .exe? I always wondered what is the file for and now I know but still I can't imageine how to use it.

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/

  • @DuelingTreeMike
    @DuelingTreeMike 2 ปีที่แล้ว

    Another good video! Is there a way to dotnet new that does not create Class1.cs? (I wish Microsoft would stop creating Class1 ! Lol)

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว +1

      No, because if it doesn't create a class then you cannot immediately add the library as a reference since there is nothing in the namespace. It is essentially a work-around. But I agree it is annoying.

    • @DuelingTreeMike
      @DuelingTreeMike 2 ปีที่แล้ว

      @@IAmTimCorey Thanks Tim! I guess I could delete it as a part of a script. I am a huge advocate for automation. I would love an opportunity to go through an automation approach between database project, local DB publish, and “dotnet scaffold”. I stumbled upon a beautiful approach that makes it so easy to keep a database, its project, and the application models all in sync. I know your preference is dapper over the entity framework, and that’s not here nor there really, but for the EF and db-first folks out there, a few may experience nirvana. Lol. I would love an opportunity to discuss with you about this and dev in general.

  • @more-uv4nl
    @more-uv4nl 5 หลายเดือนก่อน

    thanks sir !

    • @IAmTimCorey
      @IAmTimCorey  5 หลายเดือนก่อน

      You are welcome.

  • @alibozkurt-i5r
    @alibozkurt-i5r ปีที่แล้ว

    thanks

  • @ramanareddybuchepalli6844
    @ramanareddybuchepalli6844 2 ปีที่แล้ว

    When we can use Ms build when we can use dotnet cli commands

  • @humahuma5969
    @humahuma5969 2 ปีที่แล้ว

    Cool

  • @jacool5168
    @jacool5168 2 ปีที่แล้ว

    But anyway U are great!

  • @mrpolimat
    @mrpolimat 3 หลายเดือนก่อน

    please add subtitles :/

    • @IAmTimCorey
      @IAmTimCorey  3 หลายเดือนก่อน

      This video does have captions.

  • @ВасилёкСаныч
    @ВасилёкСаныч 2 ปีที่แล้ว

    tết năm nay nghèo quá không có tiền

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      That's why there is so many free videos here on TH-cam - not everyone can pay for content. I work hard to ensure that my paid content funds more free content. That way, everyone can benefit.

  • @kenanthompsonkilledmydog4753
    @kenanthompsonkilledmydog4753 8 หลายเดือนก่อน

    Awesome tutorial 👍

  • @musabalriani550
    @musabalriani550 ปีที่แล้ว

    Thank you Tim ,you saved alot of Time ⏱👍👋