Intro to .NET Standard - What it is, when to use it, and how it is different than the .NET Framework

  Рет қаралды 49,607

IAmTimCorey

IAmTimCorey

Күн бұрын

Mailing List: signup.iamtimcorey.com/
Facebook Page: / iamtimcorey
Want to see a full C# application built from scratch?
Check out this course: iamtimcorey.com/courses/cshar...
With Visual Studio 2017, Microsoft introduced a few new flavors of familiar project types. For example, the Class Library project type now has a .NET Framework version (the standard one we are used to), a .NET Core version, a Portable version, and a .NET Standard version. The .NET Standard version has been tripping people up recently, so I decided to do a video explaining what it is, how to use it, and how it is different from the other project types.
This is mostly an informational video without a ton of demo. I show off some of the pitfalls and how to resolve them, but beyond that I mostly just explain the .NET Standard project type.
The website I showed off in the video is no longer active.
0:00 - intro
0:28 - class library types
1:36 - portable class library
2:41 - standard library
4:49 - compatibility table
7:34 - Versioning rules explained
9:47 - when to choose Standard library
11:09 - setting up Standard library: create and configure
15:44 - using Standard library in a project
18:08 - comparability issues to watch out for
26:42 - summary

Пікірлер: 86
@AlbertoFranciscoMatambo
@AlbertoFranciscoMatambo 7 жыл бұрын
You are a very good teacher; you have such a methodology of teaching that is very practical and that facilitates learning, especially for those who are starting in the programming world. Starting a project from the beginning to the end applying current principles and technologies makes it very easy to understand what you teach. My sincere congratulations for your time and job and on sharing it, please continue teaching us, we thank you very much.
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
I appreciate the kind words.
@TP_Raks
@TP_Raks 4 жыл бұрын
Hey Tim, Sending love and appreciation all the way from South Africa ♥️🙌🏾
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks!
@onyebuchiboss
@onyebuchiboss 5 жыл бұрын
Thanks Tim, i just got a good grasp about the .Net framework and standards.
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
Excellent.
@4667malik
@4667malik 6 жыл бұрын
Thax for this amazing video it helps me a lot to understand the basic difference among the different class library projects
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
You are welcome. I'm glad it cleared some things up for you.
@Gruggo
@Gruggo 7 жыл бұрын
Fantastic video, really great explanation of this.
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
I'm glad you enjoyed it.
@asyncawake9011
@asyncawake9011 6 жыл бұрын
I appreciate the introduction: For beginners the "similar sounding/looking" .net framework and .net standard options (when you create a new project) can a bit confusing and you're intro helps to clear that up a good deal :)
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Excellent! I'm glad it helped clear things up.
@nishan375
@nishan375 3 жыл бұрын
Thanks a lot for the clear presentation. This helped me a lot.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Glad it was helpful!
@imadabab
@imadabab 4 жыл бұрын
Excellent tutorial as usual. Thanks a lot.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Glad you liked it!
@channaduminda5072
@channaduminda5072 4 жыл бұрын
Thank you Tim. Very helpful.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@Disneyapocolapse
@Disneyapocolapse 4 жыл бұрын
Thanks for the Vid. was looking for a great explanation
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
You are welcome.
@ShinobiEngineer
@ShinobiEngineer 4 жыл бұрын
Clear as water! 🤓👍
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks!
@RalfsBalodis
@RalfsBalodis 3 жыл бұрын
0:00 - intro 0:28 - class library types 1:36 - portable class library 2:41 - standard library 4:49 - compatibility table 7:34 - Versioning rules explained 9:47 - when to choose Standard library 11:09 - setting up Standard library: create and configure 15:44 - using Standard library in a project 18:08 - comparability issues to watch out for 26:42 - summary
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Thanks! I just added it to the description.
@eugeneshcherbo9821
@eugeneshcherbo9821 3 жыл бұрын
Hey, Tim. Great explanation! Thanks for that! Do you know probably where I can read or watch about how all of this stuff works under the hood? I mean what happens when we compile a .Net Standard library and how actually the method from the library is resolved by runtime. I'm too curious about this. Thanks!
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
You can check out the source code for it on GitHub since it is all open source or you could read more about it on docs.microsoft.com
@warrior100girl
@warrior100girl 4 жыл бұрын
Thank you for your videos. Really helps me for college and work. Are you using VS Community, Professional or Enterprise? I noticed that my Community Version doesn´t have all options you are showing in many of your videos.
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
I am using Enterprise but I rarely use the additional features in videos and when I do, I try to call it out (Unit Testing is the only one that comes to mind - live unit testing is great).
@TheBausahab
@TheBausahab 3 жыл бұрын
Wow... very solid..thank you..
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Welcome 😊
@RoughSubset
@RoughSubset 6 жыл бұрын
Thanks for the intro to .net standard. I do have a question though, I'm building an asp .net core app with ef core but I need access to the SqlFileStream API that is only available in the full .net framework. Would using a .net standard library solve the issue for me. I imagine that the .net standard library would act as a middle man and allow the core app to access full .net APIs through the standard library?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Well, the .NET Standard is just an interface. If something isn't available in .NET Core, it won't work in .NET Standard (ish - there are exceptions but they then won't work in .NET Core). Your best option, if you really can't get around using SqlFileStream is probably to put it behind an API and then call the API from .NET Standard.
@rhyaam
@rhyaam 3 жыл бұрын
Your videos are excellent. Do you have any examples of wiring up .Net Core micro services? For example, a Currency Exchange and Currency Conversion Micro Service
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Not yet, but they are coming.
@fadinum87
@fadinum87 6 жыл бұрын
its good time to start learn c# beutiful language and easy to learn
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Yes it is.
@dogburrito
@dogburrito 4 жыл бұрын
Swell video!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Thanks!
@FinkPatricio
@FinkPatricio 6 жыл бұрын
So with the .Net Standard i can do a WPF Desktop App that will run in Windows MacOS and Linux?
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
No. The .Net Standard is an interface for C# code compatibility across .Net Framework, .Net Core, and others. It is not a new language with new features. It is also strictly for code, not for user interfaces. That means it does not touch WinForms, WPF, ASP.NET, etc. This is why we have ASP.NET Core (the version that will run on Linux and Mac) while still having ASP.NET (.NET Framework version that runs on Windows). If you need a UI that works on Mac and Linux, you will need to look into Xamarin Forms. You can still use .Net Standard for your code though.
@skyBlue_360
@skyBlue_360 4 жыл бұрын
I'm currently working on a project in WinForms and you said on other video that we could use .net standard for our code & also use .net framework for UI so that when the time comes, we could easily migrate to .net core right?
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
Yes, when you create your class library, make it a .NET Standard 2.0 library. That way you can use that same library in .NET Core when you upgrade WinForms to .NET Core.
@skyBlue_360
@skyBlue_360 4 жыл бұрын
@@IAmTimCorey how about my Winforms UI? will I create that again from scratch in .net core? or there is a migrate procedure to follow that enable upgrade of WinForm easier? Thank you.
@isaahliu
@isaahliu 5 жыл бұрын
thank you
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
You are most welcome. Thanks for watching.
@asdasddas100
@asdasddas100 7 жыл бұрын
How do you get the references thing to show up over methods? I had it in VS 2015 but have no idea now to get it in 2017
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
That feature is called Code Lens. To turn it on or change the preferences for it, go to Tools → Options → Text Editor → All Languages → CodeLens
@JuiceBan
@JuiceBan 6 жыл бұрын
Just one addition to what Tim already said about Code Lens - it's not available in Community edition of VS. You can find it in Enterprise and Professional editions only.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
Good point. Thanks for pointing that out.
@kingsingh1973
@kingsingh1973 7 жыл бұрын
Is it possible to create a .net standard 1.6 library OSX and distribute to other platforms without Nuget?
@IAmTimCorey
@IAmTimCorey 7 жыл бұрын
Not quite sure what you are asking. A .NET Standard library could be used by any .NET solution, which would include .NET Core. .NET Core works on OSX so you could create a project that would run on OSX. However, I'm not sure that you can just deploy a .NET Standard project as a library on OSX. I believe it still has to be called from another .NET project (such as .NET Core). As far as needing NuGet, you don't need to distribute via NuGet for any project. It is just a convenience.
@sandeepbondugula5243
@sandeepbondugula5243 3 жыл бұрын
Hi Tim, may be I’m still confused 🤷‍♂️. If they have .Net Framework (which runs only on Windows) and .Net Core which is a cross platform framework (which runs on Windows, Linux and MAC) then why would we need .Net Standard ?
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
So we can create class libraries that can be accessed by both .NET Framework and .NET Core projects (as well as Xamarin projects). It is especially helpful as you upgrade to .NET Core.
@miladebeid9396
@miladebeid9396 4 жыл бұрын
Hello sir, i learned c# and want to move on to web development via c# frameworks and i am so confused, what's the next steps,? please help!
@IAmTimCorey
@IAmTimCorey 4 жыл бұрын
This course should help you figure out where to start: www.udemy.com/course/which-aspnet-core/?referralCode=668AC17A9CEDF2067E69 (note that it does not cover .NET Framework, just .NET Core)
@sharathcv
@sharathcv 3 жыл бұрын
Thank you so much for this video. Can we conclude the following: There is the .net standard and then the .net standard class library (that we create). These are two different things. One is a specification and other is a class library that we may want to create that targets. There is no implementation called .net Standard, or can we say that .net standard library is the framework based on .net standard, and both .net core and .net framework uses .net standard library? Please let me know. When I write it down its all clear, but when I think of it again, it gets confusing :)
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
The .NET Standard is the equivalent of an interface. A class library of type .NET Standard is like implementing that interface.
@sharathcv
@sharathcv Жыл бұрын
@@IAmTimCorey Thanks Tim!
@jamie-leejohns3377
@jamie-leejohns3377 5 жыл бұрын
Is .NET Standard stabler now with the release of 2.0? 2.0 and 2.1 being a year apart seems a sign that development is slowing down
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
.NET Standard is definitely stable. Feel free to rely on it in a production environment without worries. The benefit of .NET Standard is that you get what you get at a certain version and that will never change (they did have a hiccup in that process at 1.6, I believe but that shouldn't happen again). That means it is a stable target. It also means that if you don't mind upgrading .NET Standard versions, you will only get more features, not lose any existing features. It just won't support as many older platforms.
@ASHOK_162
@ASHOK_162 3 жыл бұрын
19:15 You said .NET Standard is Additive, Then why do you need to change versions?
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
It is additive in what it supports but that support comes from changes in the actual frameworks. So we need to use an earlier version of the .NET Standard if the frameworks we are supporting have not yet been updated to support the later versions of the .NET Standard.
@danielpatfield4779
@danielpatfield4779 3 жыл бұрын
Ok, as I view this - it's 2020. You say that if I don't NEED standard, go with framework (or Core or whatever). So, when would I NEED standard?
@muhammadwaleed7189
@muhammadwaleed7189 3 жыл бұрын
Hey, Can you please guide where to start the course i am checking out his channel but i can`t find a playlist with a title of C# full course ....
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
When you have more than one project type accessing the same class library (one .NET Framework, one .NET Core or Xamarin). This is especially helpful as you transition your project over to .NET Core. You can convert your class library first to .NET Standard. The app will still work. Then you can change your UI over to .NET Core.
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
Muhammad - here you go: kzbin.info/www/bejne/gobZY2OHrb2dnNk
@Layarion
@Layarion 5 жыл бұрын
wait, if the .net framework is the desktop, what's the universal windows platform?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
UWP is for all Windows platforms, including Xbox (which runs a version of Windows).
@camelCased
@camelCased 5 жыл бұрын
Thanks for the video, it is a really useful and clear introduction. Your channel name tempts me to create a channel named YouAreMyViewer :D
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
lol, go for it.
@mdmoinmoin8888
@mdmoinmoin8888 3 жыл бұрын
👌
@IAmTimCorey
@IAmTimCorey 3 жыл бұрын
👍
@manuelrosendocastroiglesia2803
@manuelrosendocastroiglesia2803 2 жыл бұрын
El enlace github ya no es operativo. ;(
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Yep, they removed it when they did not feel it was necessary anymore.
@drip888
@drip888 2 жыл бұрын
the website you showed doesn't exist anymore
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Yep, they changed things once .NET 5 came out. However, the information still applies.
@drip888
@drip888 2 жыл бұрын
@@IAmTimCorey i have raised a question in this video, please help me in that............
@drip888
@drip888 2 жыл бұрын
in the .net versions, i am only seeing 1. .NET Standard 2.0 2. .NET Standard 2.1 3. .NET Core 2.1 (Long-term support) 4. .NET Core 3.1 (Long-term support) 5. .NET 5.0 (Current) also in dependencies, i am not seeing SDK (when i chose 5.0) what i am seeing is two stuff 1. Analyzers a) Microsoft.CodeAnalysis.CSharp.NetAnalyzers b) Microsoft.CodeAnalysis.NetAnalyzers 2. Frameworks a) Microsoft.NETCore.App in the target framework, u hare having all .NET Framework, for me its all .NET Core what to do????????????????????????? update: I was using visual studio 2019, now I tried with 2017 but I am getting the same results.............
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You have to install the frameworks to use them. However, if you don't need the .NET Framework, don't install it. Use the current version of .NET (which should be .NET 6 now).
@drip888
@drip888 2 жыл бұрын
@@IAmTimCorey sir, i did install literally everything in the installer of visual studio (EVERYTHING), should i install it as a package(.net standard) from Microsoft website?
@joelarpin473
@joelarpin473 5 жыл бұрын
ummm, you sound like a great teacher, and you have a lot of great comments, but this isn't for absolute beginners. I have no Idea what .Net is. You started off showing what the different types of .Net are, great, but what is it?
@IAmTimCorey
@IAmTimCorey 5 жыл бұрын
So, you jumped into an intermediate-level video and what you really need is the beginning. Sorry about that. I totally understand how this can be confusing. Unfortunately there isn't a really good way of telling you when to watch a video. However, in your case I know exactly where to start you off (and where you should go next). I have a course series called Foundation in C# that I am publishing. The first course in the series teaches you about what C# is and the basics of how to use Visual Studio (and where to get it for free). This first course is free: www.iamtimcorey.com/p/foundation-in-c-module-1-getting-started/ After that, you can consider if you want to continue moving forward in learning C#. If so, you can take course #2 in the series, which will start you in on common syntax: www.iamtimcorey.com/p/foundation-in-c-common-syntax/
@williamheckman4597
@williamheckman4597 6 жыл бұрын
Remember way back when Microsoft promised .Net to run on any platform? Well that was basically a lie. So now, 15 years later, Microsoft had to actually make this happen because the Open Source community is eating their lunch on the Internet.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I think the bigger deal is the new vision and direction at Microsoft, specifically in the software development area. MS has transitioned into one of the biggest open-source friendly companies out there. While I wish it would have happened earlier, that's the past. Moving forward today, Microsoft is providing a great system that works across all devices and platforms and they are supporting the open source community while they do it (they are one of the largest contributors to git, a lot of their own code is open source, the promote open source projects instead of forcing their own versions, etc.) Now is a great time to be a C# developer.
@YesYou-zy7kp
@YesYou-zy7kp 6 жыл бұрын
Yeah, good idea to use Open Source from "WHO KNOWS WHERE IT CAME FROM." I NEVER use Open Source that some Tom,Dick and Harry wrote.
@IAmTimCorey
@IAmTimCorey 6 жыл бұрын
I'm not sure I would take that approach. The idea behind open source is that it is open. You can read the source code. You can own a copy of it. If someone tries to put malicious code into an application, they have to do it in full view of the world. Compare that with closed source software, where no one has a clue if something bad is happening behind the scenes (and there have been multiple cases of that just in the past year - not always malicious, but serious and scary regardless). Now, I don't advocate using every bit of open source software just because it is open source. You do need to weigh the size of the team working on the project, how active the project is, what the support level is like when new problems arise, etc. With that being said, the world relies on open source these days. That is a good thing because we get to build on the shoulders of giants instead of wasting our time trying to build something half as good.
3 Ways Every Developer Fails And How To Avoid Them
26:16
IAmTimCorey
Рет қаралды 4,1 М.
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 693 М.
How many pencils can hold me up?
00:40
A4
Рет қаралды 19 МЛН
The delivery rescued them
00:52
Mamasoboliha
Рет қаралды 7 МЛН
Delegates in C# - A practical demonstration, including Action and Func
1:09:11
.NET Core vs .NET Framework - What's the difference?
25:26
IAmTimCorey
Рет қаралды 641 М.