@@ -15,7 +15,6 @@ This is a **nuget/paket** main scaffold component to create others packages
15
15
* ### [ Paket] ( https://fsprojects.github.io/Paket/index.html )
16
16
> Integrated with [ Nuget] ( https://www.nuget.org ) to manage dependencies, with more clear files and allow use ** Git** dependencies
17
17
18
-
19
18
## Getting Started
20
19
21
20
### 1. Install [ .NET Core] ( https://cakebuild.net/docs/tutorials/getting-started )
@@ -34,7 +33,7 @@ This is a **nuget/paket** main scaffold component to create others packages
34
33
Use [Chocolatey](https://chocolatey.org/)
35
34
36
35
` ` ` bash
37
- choco install nuget.commandline
36
+ choco install nuget.commandline
38
37
` ` `
39
38
40
39
# ### 2.1 Install [Azure Artifacts Credential Provider](https://github.com/microsoft/artifacts-credprovider)
@@ -53,36 +52,38 @@ Use [Chocolatey](https://chocolatey.org/)
53
52
Use [.NET Core tools](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-local-tool) to install ** paket** command line locally
54
53
55
54
` ` ` bash
56
- dotnet tool restore
55
+ dotnet tool install -g paket
57
56
` ` `
58
57
58
+ ** PS:** Install globally if you will use paket in others projects. You can use globally also if your project not use .NET Core.
59
+
59
60
# ### 3.1 Install Azure pipelines CLI (OPTIONAL)
60
61
61
62
Use [Chocolatey](https://chocolatey.org/)
62
63
63
64
` ` ` bash
64
- # Install base Azure CLI (command line)
65
- choco install azure-cli
65
+ # Install base Azure CLI (command line)
66
+ choco install azure-cli
66
67
67
- # Install Azure Devops extensions
68
- az extension add --name azure-devops
68
+ # Install Azure Devops extensions
69
+ az extension add --name azure-devops
69
70
` ` `
70
71
71
72
# ## 4. Install all DEPENDENCIES and restore references
72
73
73
74
` ` ` bash
74
- dotnet paket restore
75
- dotnet restore
75
+ paket restore
76
+ dotnet restore
76
77
` ` `
77
78
78
79
# ## 5. Build and test the solution
79
80
80
81
` ` ` bash
81
- # Build the solution
82
- dotnet build
82
+ # Build the solution
83
+ dotnet build
83
84
84
- # Run all tests
85
- dotnet test
85
+ # Run all tests
86
+ dotnet test
86
87
` ` `
87
88
88
89
# # Project structure
@@ -115,15 +116,23 @@ Your project folders structure should be:
115
116
2. Genarate the ` ` ` .nupkg` ` ` file
116
117
117
118
` ` ` bash
118
- # Pack your component to the path nugets/*.nupkg
119
- dotnet pack --include-symbols --configuration Release --output nugets [your-component-project]
119
+ # Pack your component to the path nugets/*.nupkg
120
+ dotnet pack --include-symbols --configuration Release --output nugets [your-component-project]
120
121
` ` `
121
122
> ** PS:** If you not pass the ** _--outputs_** flag, the ` ` ` .nupkg` ` ` file is generated in: ` ` ` [your-component-project]/bin/Release` ` ` by default
122
123
123
124
Or use Visual Studio and right click on your project component under Solution explorer, and click ** Pack** .
124
125
125
126
! [component-pack-nupkg](./images/component-pack.png)
126
127
128
+ # ## Error "Pack Task"
129
+
130
+ If you got a ` Pack task` error with .NET Core CLI or in ** Visual Studio** , use [` Paket pack` ](https://fsprojects.github.io/Paket/paket-pack.html) command:
131
+
132
+ ` ` ` bash
133
+ paket pack --template [your-component-project]\[ your-component-project].csproj.paket.template --build-config Release --symbols nugets
134
+ ` ` `
135
+
127
136
# # Testing your package locally
128
137
129
138
# ## Create a local feed "server"
@@ -133,7 +142,7 @@ Your project folders structure should be:
133
142
Publish the package to local repo using ` nuget add` :
134
143
135
144
` ` ` bash
136
- nuget add [my-component.{version-number}].nupkg -source [your/local-repo/directory]
145
+ nuget add [my-component.{version-number}].nupkg -source [your/local-repo/directory]
137
146
` ` `
138
147
139
148
# ## Add the package/component to a application
@@ -174,14 +183,14 @@ Your project folders structure should be:
174
183
5. Restore the project to provide authentication
175
184
176
185
` ` ` bash
177
- nuget restore
186
+ nuget restore
178
187
` ` `
179
188
180
189
6. Push to the ** Azure Artifacts** feed
181
190
182
191
` ` ` bash
183
- # See the nuget.config file <packageSources> tag
184
- nuget push -Source " [your-feed-name]" -ApiKey az [path/to/nupkg-file].nupkg
192
+ # See the nuget.config file <packageSources> tag
193
+ nuget push -Source " [your-feed-name]" -ApiKey az [path/to/nupkg-file].nupkg
185
194
` ` `
186
195
187
196
# # Install remote package to an application
@@ -205,7 +214,7 @@ Your project folders structure should be:
205
214
# [YourAppProject]: Is project name inside of the solution, that to use this dependency like a reference
206
215
207
216
# # Using dotnet core
208
- dotnet paket add --project [YourAppProject]/[YourAppProject].csproj {YourComponent.PackageIdName}
217
+ paket add --project [YourAppProject]/[YourAppProject].csproj {YourComponent.PackageIdName}
209
218
210
219
# # Using .NET Framework
211
220
.\. paket\p aket.exe add --project [YourAppProject]/[YourAppProject].csproj {YourComponent.PackageIdName}
@@ -242,3 +251,7 @@ Your project folders structure should be:
242
251
> ** ` Right click` ** on References under the component ** ` project => Manage Nuget Packages` **
243
252
244
253
5. On the next screen, search by the ** packageId** and click on ** ` Install` ** button
254
+
255
+ # # Problems and workarounds
256
+
257
+ See the wiki pages in: [CsharpComponentBase Wiki](https://dev.azure.com/opitblast/CsharpComponentBase/_wiki/wikis/CsharpComponentBase.wiki/1/Known-issues)
0 commit comments