# Creating and Publishing .NET NuGet Packages

### SETP-1: Prerequisites

*   Install [.NET SDK](https://dotnet.microsoft.com/download) (8.0 or newer recommended)
    
*   Create a free [NuGet.org account](https://www.nuget.org/)
    

**Verify installation:** After a successful installation, you could verify by the cmd/bash.

```bash
dotnet --version
```

### SETP-2: Create a class library project

Using this command, a project named `MyAwesomePackage` will be created.

```bash
dotnet new classlib -n MyAwesomePackage
cd MyAwesomePackage
```

### SETP-3: Open an Editor and Add your code

XML comments are necessary for proper documentation.

```csharp
namespace MyAwesomePackage;

/// <summary>
/// Provides basic arithmetic operations
/// </summary>
public class Calculator
{
    /// <summary>
    /// Adds two integers
    /// </summary>
    /// <param name="a">First number</param>
    /// <param name="b">Second number</param>
    /// <returns>Sum of a and b</returns>
    public int Add(int a, int b) => a + b;
    
    // Add similar documentation for Multiply
}
```

### SETP-4: Configure Package Metadata

Here is a basic project setup file, `MyAwesomePackage.csproj`

```xml
<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFramework>net9.0</TargetFramework>
		
		<!-- Core Package Metadata -->
		<PackageId>MyAwesomePackage</PackageId>
		<Version>1.0.1</Version>
		<Authors>bishojit</Authors>
		<Company>BIKIRAN</Company>
		<Description>Utility functions for common operations</Description>
		<PackageTags>utilities helper tools</PackageTags>

		<!-- Recommended Additions -->
		<PackageProjectUrl>https://github.com/bikirandev/bikiran.utils</PackageProjectUrl>
		<RepositoryUrl>https://github.com/bikirandev/bikiran.utils.git</RepositoryUrl>
		<PackageLicenseExpression>MIT</PackageLicenseExpression>
		<IncludeSymbols>true</IncludeSymbols>
		<SymbolPackageFormat>snupkg</SymbolPackageFormat>
		
		<!-- Add below existing PackageTags -->
		<PackageReadmeFile>README.md</PackageReadmeFile>
	</PropertyGroup>

	<ItemGroup>
		<!-- Add NuGet.Protocol package reference -->
		<PackageReference Include="NuGet.Protocol" Version="6.13.2" />
	</ItemGroup>

	<ItemGroup>
		<None Include="README.md" Pack="true" PackagePath="\" />
	</ItemGroup>
</Project>
```

### STEP-5: Build the Package

After developing all the operations, you need to build the package before publishing it.

```bash
dotnet build
```

### STEP-6: Create NuGet Package

Make sure to fix all errors and warnings before publishing.

```bash
dotnet pack --configuration Release
```

### STEP-7: Requirements before publishing

1.  Add a LICENSE File (Required)
    
2.  Add [README.md](http://README.md) (Required)
    
3.  I repeat, must add XML comment documentation on each class.
    
4.  Add Package Icon (Optional)
    

### STEP-8: Publish to [NuGet.org](http://NuGet.org)

*   Log in > Click Upload (On Top Navigation Bar)
    
*   Locate your file and upload it.
    
*   After a successful upload, complete the form.
    
*   After a few minutes, the Package will be approved.
    

### **Important Notes:**

1.  Versioning: Increment `<Version>` before each new release
    
2.  The package ID must be unique across NuGet.org
    
3.  Recommended: Use [Semantic Versioning](https://semver.org/)
    
4.  For private feeds: Change `--source` to your feed URL
    

### **Next Steps:**

1.  Add documentation in [README.md](http://README.md)
    
2.  Consider adding:
    
    *   XML documentation comments
        
    *   License file
        
    *   Icon
        
    *   Release notes
        

### **CONTACT:**

I’m Kumar Bishojit Paul, the Founder and CEO of [**BIKIRAN**](https://www.bikiran.com/). If you need further assistance, please leave a comment. I’m interested in helping you.


---

## 🏢 About Bikiran

**[Bikiran](https://bikiran.com/)** is a software development and cloud infrastructure company founded in 2012, headquartered in Khulna, Bangladesh. With 15,000+ clients and over a decade of experience, Bikiran builds and operates a suite of products spanning domain services, cloud hosting, app deployment, workflow automation, and developer tools.

| SL  | Topic        | Product                                                              | Description                                             |
| --- | ------------ | -------------------------------------------------------------------- | ------------------------------------------------------- |
| 1   | Website      | [Bikiran](https://bikiran.com/)                                      | Main platform — Domain, hosting & cloud services        |
| 2   | Website      | [Edusoft](https://www.edusoft.com.bd/)                               | Education management software for institutions          |
| 3   | Website      | [n8n Clouds](https://n8nclouds.com/)                                 | Managed n8n workflow automation hosting                 |
| 4   | Website      | [Timestamp Zone](https://www.timestamp.zone/)                        | Unix timestamp converter & timezone tool                |
| 5   | Website      | [PDFpi](https://pdfpi.bikiran.com/)                                  | Online PDF processing & manipulation tool               |
| 6   | Website      | [Blog](https://blog.bikiran.com/)                                    | Technical articles, guides & tutorials                  |
| 7   | Website      | [Support](https://support.bikiran.com/)                              | 24/7 customer support portal                            |
| 8   | Website      | [Probackup](https://probackup.bikiran.com/)                          | Automated database backup for SQL, PostgreSQL & MongoDB |
| 9   | Service      | [Domain](https://www.bikiran.com/domain)                             | Domain registration, transfer & DNS management          |
| 10  | Service      | [Hosting](https://www.bikiran.com/services/hosting/web)              | Web, app & email hosting on NVMe SSD                    |
| 11  | Service      | Email & SMS                                                          | Bulk email & SMS notification service                   |
| 12  | npm          | [Chronopick](https://www.npmjs.com/package/@bikiran/chronopick)      | Date & time picker React component                      |
| 13  | npm          | [Rich Editor](https://www.npmjs.com/package/@bikiran/editor)         | WYSIWYG rich text editor for React                      |
| 14  | npm          | [Button](https://www.npmjs.com/package/@bikiran/button)              | Reusable React button component library                 |
| 15  | npm          | [Electron Boilerplate](https://www.npmjs.com/package/create-edx-app) | CLI to scaffold Electron.js project templates           |
| 16  | NuGet        | [Bkash](https://www.nuget.org/packages/Bikiran.Payment.Bkash)        | bKash payment gateway integration for .NET              |
| 17  | NuGet        | [Bikiran Engine](https://www.nuget.org/packages/Bikiran.Engine)      | Core .NET engine library for Bikiran services           |
| 18  | Open Source  | [PDFpi](https://github.com/bikirandev/pdfpi)                         | PDF processing tool — open source                       |
| 19  | Open Source  | [Bikiran Engine](https://github.com/bikirandev/Bikiran.Engine)       | Core .NET engine — open source                          |
| 20  | Open Source  | [Drive CLI](https://github.com/bikirandev/DriveCLI)                  | CLI tool to manage Google Drive from terminal           |
| 21  | Docker       | [Pgsql](https://github.com/bikirandev/docker-pgsql)                  | Docker setup for PostgreSQL                             |
| 22  | Docker       | [n8n](https://github.com/bikirandev/docker-n8n)                      | Docker setup for n8n automation                         |
| 23  | Docker       | [Pgadmin](https://github.com/bikirandev/docker-pgadmin)              | Docker setup for pgAdmin                                |
| 24  | Social Media | [LinkedIn](https://www.linkedin.com/company/bikiran12)               | Bikiran on LinkedIn                                     |
| 25  | Social Media | [Facebook](https://www.facebook.com/bikiran12)                       | Bikiran on Facebook                                     |
| 26  | Social Media | [YouTube](https://www.youtube.com/@bikiranofficial)                  | Bikiran on YouTube                                      |
| 27  | Social Media | [FB n8nClouds](https://www.facebook.com/n8nclouds)                   | n8n Clouds on Facebook                                  |
