Code Monkey home page Code Monkey logo

csharp-build-tools-nuget-exercise's Introduction

C# Build Tools - Nuget Package Manager

Learning Objectives

  • to understand projects and solutions in c#
  • start exploring namespaces and references
  • add/remove a nuget package

Exercise (for Windows users with Visual Studio)

Create a new Console App project in a suitable location

Make sure that the Project name field says something like <>.Console and that the Solution name has the <> In my example I've created ReplicantsRUs for the Solution Name and ReplicantsRUs.Console for the project.

Next open up the Package Manager Console which can be found under Tools - Package Manager - Package Manager Console on the menu in Visual Studio. Now type the following: install-package system.speech

What will happen now is that nuget should download the relevant dependencies required to install this nuget package. This is what a successful package install looks like!

Now ensure your Program.cs looks like above.

If you now F5 to build and run this, you should hear the hello phrase from your PC.

What has just happened? Well you've just referenced some other code in a different namespace: System.Speech.Synthesis You don't need to worry how that text to speech code works, just know that someone wrote that code for you and you've just added it to your project. http://www.nuget.org contains all the packages you can easily add to your project.

By issuing the uninstall-package system.speech command you can remove a nuget package from your project. Note that Visual Studio now doesn't recognise the namespace or object in the class. You'll have to install-package system.speech to make it work again.

csharp-build-tools-nuget-exercise's People

Contributors

uerbzr avatar

Watchers

Chris avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.