Тёмный

NuGet Central Package Management Is AWSOME! .NET Global Packages & Versions Simplified 

James Montemagno
Подписаться 137 тыс.
Просмотров 10 тыс.
50% 1

NuGet is essential for any and all .NET applications, but tracking versions, adding references, and ensuring everything is kept up to date can be a pain in large applications. Well Central Package Management is here introducing simplified version controls and even the ability to add global packages from a single location. You have to check this out.
Links:
Docs: learn.microsoft.com/nuget/con...
.NET MAUI Specifics: github.com/dotnet/maui/tree/m...
Chatpers:
00:00 - Intro
01:51 - Enabling Central Package Management
05:00 - Managing Versions Centrally
07:55 - Global NuGet Package References
09:28 - Wrap-up
Join this channel to get access to perks:
/ @jamesmontemagno
👕 Buy some swag! - jamesmontemagno.myspreadshop....
☕️ Buy me a coffee - www.buymeacoffee.com/jamesmon...
Follow:
👨‍💻 GitHub: github.com/jamesmontemagno
🦜 Twitter: / jamesmontemagno
📄 Website: www.montemagno.com
📰 Newsletter: newsletter.montemagno.com/
Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: cleclothingco.myshopify.com/
What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre: / bcez1onhiqx
My Setup:
📷 Canon M50 Mark II - amzn.to/3P8R7lp
💡 Nanoleaf Elements Lights - amzn.to/3umwJVW
🎙 Blue Spark Microphone - amzn.to/3qgtYkq
🎙 Blue Pop Filter - amzn.to/3jEWM3r
🤳 Rode Microphone Arm - amzn.to/2Z68AlE
🎧 Sony MDR7306 Headphones - amzn.to/372jxta
📲 Stream Deck - amzn.to/373Uk1n
🖱 MX Master 2S Mouse - amzn.to/3d7J2gj
⌨️ Tecware Phantom Keyboard - amzn.to/3aUP4y9
#dotnet #nuget #visualstudio #dotnetmaui

Наука

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 46   
@KannanArjunan
@KannanArjunan 13 дней назад
Super!... Useful tips!
@HeinrichDaHammer
@HeinrichDaHammer 10 месяцев назад
This really makes massive projects so much easier! Thank you.
@krccmsitp2884
@krccmsitp2884 10 месяцев назад
I already knew about CPM, but not GlobalPackageReference. Thanks for sharing!
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
Me either! so cool!
@anverabdullayev9814
@anverabdullayev9814 10 месяцев назад
Great feature James. Will do it tomorrow on my projects😍
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
Noice! let me know how it goes!!!!
@r-naotwo6290
@r-naotwo6290 10 месяцев назад
I haven't seen this before. Thanks for the insight!
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
Was new to me as well even though it has been out for a while. So many nice things... sometimes just discovering them is the problem lol.
@lolroflxd
@lolroflxd 10 месяцев назад
Awesome :o that is exactly what i need currently. Thanks a lot
@markmbouma
@markmbouma 10 месяцев назад
I’ve learned something new. Thanks
@tzurdo1
@tzurdo1 10 месяцев назад
Very useful video! Thanks!
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
Glad it was helpful!
@stephenyork7318
@stephenyork7318 9 месяцев назад
Seriously nice feature.
@brianflowers8417
@brianflowers8417 3 месяца назад
Awesome video, so I subscribed first. But, reading the description, and finding out your a Clevelander!. Me too 😆👍!
@pilotboba
@pilotboba 9 месяцев назад
Does: dotnet add package Some.Package
@cadeias22
@cadeias22 10 месяцев назад
🤯🤯🤯 👏👏👏
@megasuperlexa2
@megasuperlexa2 9 месяцев назад
So what is the added value of central package management vs. just pressing "Update" in IDE for solution?
@TVsBen
@TVsBen 10 месяцев назад
I'm not clear how any of this is better than right-clicking the solution and choosing Manage NuGet Packages for Solution and just letting it update all the packages itself. Does it speed up AZDO build pipelines or something? I guess as Microsoft pushes people away from Visual Studio and towards VSCode and the command line, this will come in handy. Especially on Mac. Maybe I answered my own question.
@haslamconsultancy2152
@haslamconsultancy2152 10 месяцев назад
I guess it can be for cleaner commits. Committing in a centralised place rather than across multiple project files but it's only a very small benefit. The 2nd part of having a global package just seems nice for cleanliness also
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
That and also I think just managing everything in 1 place, no need to open every since csproj. Imagine super large projects, just saves time.
@almis6470
@almis6470 10 месяцев назад
@@JamesMontemagno but it's easier to manage nuget packages for solution using the GUI rather than adding manually the references in the props file so I'm not sure if you are saving time. It also means that I cannot use the GUI anymore to install new nugets right?
@NickSteffen
@NickSteffen 10 месяцев назад
@@almis6470 Yea, the bigger problem is that if someone doesn’t know this feature is being used and they’re used to looking at versions in the GUI, they are going to get confused real fast. The feature seems half baked because of this and may actually waste more time than it saves. You also have to wonder how committed Microsoft is in that case since they’ve disabled these type of half supported solution level flags and features in the past.
@grumpydeveloper69
@grumpydeveloper69 10 месяцев назад
@@JamesMontemagno But we already have Consolidate on the Manage packages for SOlution tab for that as well
@Umar3x16
@Umar3x16 9 месяцев назад
Is the nuget package manager taking into consideration the GlobalPackageReference when updating or adding a dependency so that it doesn't add the ref in the given project's csprojs ?
@leszekjezierski9414
@leszekjezierski9414 10 месяцев назад
Great stuff! However, one question is coming to my mind...what if each project have different set of packages?
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
That is what I showed first, you just don't specify a PackageReference per usual in the project. You just are centralizing all the versions. If ALL of your nugets are different in each project... then up to you if you want a more central place.
@ArkFen
@ArkFen 10 месяцев назад
@@JamesMontemagno not very clear still... do you mean the moment you showed somthing with a star like 8.0.0-* ? or somethings else... if you mean the star, then do we set the Version attribute inside of the projects which use different versions? will system not give us error then? Actually I have all the versions same but I was curious as well and this comment brought my attention to it
@grumpydeveloper69
@grumpydeveloper69 10 месяцев назад
@@JamesMontemagno So GlobalPackageReference is mostly useful for packages that will be in all you projects. If I have a solution with 60 projects I would not expect all of the to use FluentValidation. Does this Global reference mean the package is considered for compiling/linking your code, hence it is taken on a ride in building *all* you projects in that solution?
@sheilainglin863
@sheilainglin863 10 месяцев назад
😊😊😊❤
@grumpydeveloper69
@grumpydeveloper69 10 месяцев назад
So the PackageVersion is maintained per solution? Or could I move it up even more. As you explained we have an applicaiton consisting of multiple solutions all generating different programe and we either use multiple solutions, or solution filters. Would you need to have the Directory.Packages.props file at the solution file level, of when I use diferent subfolder for different solutions I can put it in the repo root folder for instance.
@grumpydeveloper69
@grumpydeveloper69 10 месяцев назад
Should have read the Docs, yes you can put these files up to the repo root for more global use.
@grumpydeveloper69
@grumpydeveloper69 10 месяцев назад
PackageVersion is in essence replacing the Manage Packages for solution and then use the Consolidate option? You also did not show how you would then Update a package to a newer version, can I still go the any project and say Update to latest, and VS will default to updating the Directory.Packages.props instead of adding a version to that project. Or is this a manual editing task at this time?
@vdrasutis
@vdrasutis 8 месяцев назад
You can`t use "*" in globally defined package version - Error NU1011 Centrally defined floating package versions are not allowed
@zarkokomljenovic4865
@zarkokomljenovic4865 10 месяцев назад
How does it work with Maui app? Where can I remove versions for packages that are under platforms?
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
I put a link in the video description on details. There is a lot of work in and around .NET 8 in RC2 for it
@zarkokomljenovic4865
@zarkokomljenovic4865 10 месяцев назад
@@JamesMontemagno Yeah, it looked complicated 🫣 Thanks for your response!
@MajeureX
@MajeureX 10 месяцев назад
Does this work with solutions with .NET Framework projects, or would they have to be upgraded to .NET 6?
@JamesMontemagno
@JamesMontemagno 9 месяцев назад
Need to use .NET 6+ and new project system
@amoenus_dev
@amoenus_dev 10 месяцев назад
Hey James, great video on! While I'm definitely a fan of managing packages at the solution level, I do have some reservations about the Global Reference feature. While it streamlines things, it seems a bit too broad for my liking. For example, it would be awesome if we could set Global References specific to types of projects, like Tests. I know we can achieve something similar with PackageReference, but the Global Reference feature seems like it might be a step too far in generalizing dependencies. Would love to know your thoughts on this or if there are workarounds to make Global Reference more nuanced. Keep up the good work!
@JamesMontemagno
@JamesMontemagno 10 месяцев назад
You could setup more specific rules: learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management#central-package-management-rules as an option. Based on how your items are setup
@egvijayanand
@egvijayanand 10 месяцев назад
Wildcard package versioning is not supported. A big disadvantage. Once enabled, all package versions are to be defined only in this file. And only version # can only be overridden if necessary. Reference cannot be defined directly at the project level, even if needed in only one project. A cumbersome process. It should be rather a hierarchical definition.
@MahdiMahdi-hm1md
@MahdiMahdi-hm1md 4 месяца назад
Далее
CrowdStrike IT Outage Explained by a Windows Developer
13:40
▼КОРОЛЬ СОЖРАЛ ВСЕХ 👑🍗
29:48
Просмотров 468 тыс.
Why I Quit Netflix
7:11
Просмотров 494 тыс.
Primary Constructors in C# 12 Explained!
9:39
Просмотров 23 тыс.
I Trained an AI with 10,000 Memes
14:52
Просмотров 264 тыс.
Turns out REST APIs weren't the answer (and that's OK!)
10:38