--- slideOptions: transition: slide theme: night tags: Productivity, Roles, Tutorial type: slide title: How to use nuget in git on dotnet core --- <style> mark { background-color: transparent; color: green; } mark:nth-child(3n+2) { color: blue; } mark:nth-child(3n+3) { color: red; } </style> ### HƯỚNG DẪN SỬ DỤNG KHO THƯ VIỆN NUGET TRONG DOTNET CORE Biên soạn: **Bùi Trí Công** ![](https://s.dulieutnmt.vn/doc.dulieutnmt.vn/uploads/upload_f2f25b3176749c137522932bffab47ac.png) --- <!-- .slide: data-transition="slide-in convex-out" --> #### I. LẤY TÀI KHOẢN TRUY CẬP THƯ VIỆN NUGET ---- 1. <span style="font-size:0.8em;">Đăng nhập vào git https://git.dulieutnmt.vn</span> 2. <span style="font-size:0.8em;">Truy cập theo đường dẫn: Group Sakura.Gallery > Settings > Repository > Deploy Tokens</span> <span style="font-size:0.5em;">(https://git.dulieutnmt.vn/groups/sakura.gallery/-/settings/repository)</span> 3. <span style="font-size:0.8em;">Tạo Deploy Tokens với tất cả scopes: read_repository, read_package_registry, write_package_registry</span> --- <!-- .slide: data-transition="slide-in convex-out" --> #### II. THÊM THƯ VIỆN NUGET ĐẾN DOTNET CORE ---- 1. Sử dụng Command Line thực hiện câu lệnh: <span style="font-size:0.5em; display:block; background-color: #1D1D1D; color: #ffffff; padding: 10px; border-radius: 5px">dotnet nuget add source https://git.dulieutnmt.vn/api/v4/projects/33/packages/nuget/index.json <span style="margin-left: 100px;">-\-name <Tên source></span> <span style="margin-left: 100px;">-\-username <Username_Deploy_Tokens></span> <span style="margin-left: 100px;">-\-password <Deploy_Tokens> <span style="margin-left: 100px;">-\-store-password-in-clear-text</span> 2. Add package to project: <span style="font-size:0.5em; display:block; background-color: #1D1D1D; color: #ffffff; padding: 10px; border-radius: 5px">dotnet add <Tên project> package <Tên package></span>