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.
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
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 :)
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.
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).
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 ?
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.
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
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!
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.
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)
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 :)
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?
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.
@@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.
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.
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?
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.
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.
.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.
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.
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.............
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).
@@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?
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.
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?
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/
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.
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.
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.