<commit_before>This is an example of how to use the Strongbox artifact repository manager with NuGet.

## Pre-requisites
The following is a minimal configuration in order to be able to use this tutorial:

* `Linux` OS
* `Mono` cli environment
* `nuget.exe` and `Microsoft.Build.dll` files

## Prepare project workspace

Go to the project folder and execute the following commands:

    $ mkdir -p ./bin
    $ mkdir -p ./.nuget
    $ echo '<?xml version="1.0" encoding="utf-8"?><configuration></configuration>' > ./.nuget/NuGet.config

*There should be no output if success*
> Note that `bin` and `.nuget` folders must be added to ignore list of your `VCS`

## Create NuGet configuration

### Add default push repository URL

    $ mono --runtime=v4.0 nuget.exe config -set DefaultPushSource={repositoryUrl} -ConfigFile ./nuget/NuGet.config

Example below (*there should be no output if success*):
    
    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget> mono --runtime=v4.0 nuget.exe config -set DefaultPushSource=http://localhost:8080/nuget/storages/MySource -ConfigFile ./.nuget/NuGet.config

### Set api key to use with your repository

    $ mono --runtime=v4.0 nuget.exe setApiKey {apiKey} -Source {repositoryUrl} -ConfigFile ./.nuget/NuGet.config

The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget> mono --runtime=v4.0 nuget.exe setApiKey bXktYXBpLWtleQ== -Source http://localhost:8080/nuget/storages/MySource -ConfigFile ./.nuget/NuGet.config
    The API Key '<KEY>==' was saved for 'http://localhost:8080/nuget/storages/MySource'.


## How to build

Execute the following command:

     $ mcs -t:library -out:./bin/HelloWorld.dll ./src/HelloWorld.cs

This will build the code and make `dll` library.

## How to make NuGet package

Execute the following command:

    $ mono --runtime=v4.0 nuget.exe pack ./Hello.Strongbox.Nuget.Mono.nuspec
    
The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget> mono --runtime=v4.0 nuget.exe pack ./Hello.Strongbox.Nuget.Mono.nuspec 
    Attempting to build package from 'Hello.Strongbox.Nuget.Mono.nuspec'.
    Successfully created package '/home/carlspring/strongbox-examples/hello-strongbox-nuget/Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg'.

## How to push NuGet package into Strongbox repository

Execute the following command:
    
    mono --runtime=v4.0 nuget.exe push ./Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg -ConfigFile ./.nuget/NuGet.config

The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget> mono --runtime=v4.0 nuget.exe push ./Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg -ConfigFile ./.nuget/NuGet.config
    Pushing Org.Carlspring.Strongbox.Examples.Nuget.Mono 1.0 to 'http://localhost:8080/nuget/storages/MySource'...
    Your package was pushed.

## See also:<commit_msg>SB-680 Create a hello-strongbox-nuget example (using Mono) - hello-strongbox-nuget -> hello-strongbox-nuget-mono<commit_after>This is an example of how to use the Strongbox artifact repository manager with NuGet.

## Pre-requisites
The following is a minimal configuration in order to be able to use this tutorial:

* `Linux` OS
* `Mono` cli environment
* `nuget.exe` and `Microsoft.Build.dll` files

## Prepare project workspace

Go to the root project folder and execute the following commands:

    $ mkdir -p ./bin
    $ mkdir -p ./.nuget
    $ echo '<?xml version="1.0" encoding="utf-8"?><configuration></configuration>' > ./.nuget/NuGet.config

*There should be no output if success*
> Note that `bin` and `.nuget` folders must be added to ignore list of your `VCS`

## Create NuGet configuration

### Add default push repository URL

    $ mono --runtime=v4.0 nuget.exe config -set DefaultPushSource={repositoryUrl} -ConfigFile ./nuget/NuGet.config

Example below (*there should be no output if success*):
    
    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget-mono> mono --runtime=v4.0 nuget.exe config -set DefaultPushSource=http://localhost:8080/nuget/storages/MySource -ConfigFile ./.nuget/NuGet.config

### Set api key to use with your repository

    $ mono --runtime=v4.0 nuget.exe setApiKey {apiKey} -Source {repositoryUrl} -ConfigFile ./.nuget/NuGet.config

The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget-mono> mono --runtime=v4.0 nuget.exe setApiKey bXktYXBpLWtleQ== -Source http://localhost:8080/nuget/storages/MySource -ConfigFile ./.nuget/NuGet.config
    The API Key 'bXktYXBpLWtleQ==' was saved for 'http://localhost:8080/nuget/storages/MySource'.


## How to build

Execute the following command:

     $ mcs -t:library -out:./bin/HelloWorld.dll ./src/HelloWorld.cs

This will build the code and make `dll` library.

## How to make NuGet package

Execute the following command:

    $ mono --runtime=v4.0 nuget.exe pack ./Hello.Strongbox.Nuget.Mono.nuspec
    
The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget-mono> mono --runtime=v4.0 nuget.exe pack ./Hello.Strongbox.Nuget.Mono.nuspec 
    Attempting to build package from 'Hello.Strongbox.Nuget.Mono.nuspec'.
    Successfully created package '/home/carlspring/strongbox-examples/hello-strongbox-nuget-mono/Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg'.

## How to push NuGet package into Strongbox repository

Execute the following command:
    
    mono --runtime=v4.0 nuget.exe push ./Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg -ConfigFile ./.nuget/NuGet.config

The output should be like follows:

    carlspring@linux-70e2:/home/carlspring/strongbox-examples/hello-strongbox-nuget-mono> mono --runtime=v4.0 nuget.exe push ./Org.Carlspring.Strongbox.Examples.Nuget.Mono.1.0.nupkg -ConfigFile ./.nuget/NuGet.config
    Pushing Org.Carlspring.Strongbox.Examples.Nuget.Mono 1.0 to 'http://localhost:8080/nuget/storages/MySource'...
    Your package was pushed.

## See also:
{'fraction_non_alphanumeric': 0.11846802986043492, 'fraction_numerical': 0.01833820188250568, 'mean_word_length': 3.9107569721115536, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 2, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3206578', 'n_tokens_mistral': 2202, 'n_tokens_neox': 2007, 'n_words': 530}