|
| 1 | +# SharpCoreDB.Serilog.Sinks - NuGet Package Build Guide |
| 2 | + |
| 3 | +## Package Includes Logo |
| 4 | + |
| 5 | +The NuGet package now includes the SharpCoreDB logo (SharpCoreDB.jpg) which will be displayed on NuGet.org. |
| 6 | + |
| 7 | +## Logo Location |
| 8 | + |
| 9 | +The logo is referenced from the main SharpCoreDB project: |
| 10 | +``` |
| 11 | +..\SharpCoreDB\SharpCoreDB.jpg |
| 12 | +``` |
| 13 | + |
| 14 | +If the logo file doesn't exist, the build will still succeed (the Condition attribute ensures this). |
| 15 | + |
| 16 | +## Creating the NuGet Package |
| 17 | + |
| 18 | +### Option 1: Visual Studio |
| 19 | + |
| 20 | +1. Right-click on `SharpCoreDB.Serilog.Sinks` project in Solution Explorer |
| 21 | +2. Click **Pack** |
| 22 | +3. Package will be created in `bin\Release\SharpCoreDB.Serilog.Sinks.1.0.0.nupkg` |
| 23 | + |
| 24 | +### Option 2: Command Line |
| 25 | + |
| 26 | +```bash |
| 27 | +cd SharpCoreDB.Serilog.Sinks |
| 28 | +dotnet pack -c Release |
| 29 | +``` |
| 30 | + |
| 31 | +## Verifying Package Contents |
| 32 | + |
| 33 | +### Using NuGet Package Explorer |
| 34 | + |
| 35 | +1. Download [NuGet Package Explorer](https://github.com/NuGetPackageExplorer/NuGetPackageExplorer) |
| 36 | +2. Open `bin\Release\SharpCoreDB.Serilog.Sinks.1.0.0.nupkg` |
| 37 | +3. Verify the following files are included: |
| 38 | + - ? `SharpCoreDB.jpg` (in root) |
| 39 | + - ? `README.md` (in root) |
| 40 | + - ? `lib/net10.0/SharpCoreDB.Serilog.Sinks.dll` |
| 41 | + - ? `lib/net10.0/SharpCoreDB.Serilog.Sinks.xml` (documentation) |
| 42 | + |
| 43 | +### Using Command Line |
| 44 | + |
| 45 | +```bash |
| 46 | +# Extract package contents to temp folder |
| 47 | +Expand-Archive bin\Release\SharpCoreDB.Serilog.Sinks.1.0.0.nupkg -DestinationPath temp |
| 48 | + |
| 49 | +# Check if logo exists |
| 50 | +dir temp\SharpCoreDB.jpg |
| 51 | + |
| 52 | +# Check if README exists |
| 53 | +dir temp\README.md |
| 54 | + |
| 55 | +# Cleanup |
| 56 | +Remove-Item -Path temp -Recurse -Force |
| 57 | +``` |
| 58 | + |
| 59 | +## What Will Appear on NuGet.org |
| 60 | + |
| 61 | +When you publish this package to NuGet.org, users will see: |
| 62 | + |
| 63 | +1. **Logo**: SharpCoreDB.jpg displayed prominently |
| 64 | +2. **README**: Full documentation with usage examples |
| 65 | +3. **Package Metadata**: |
| 66 | + - Title: SharpCoreDB.Serilog.Sinks |
| 67 | + - Description: Serilog sink with encryption and batching |
| 68 | + - Tags: serilog, sink, sharpcoredb, database, logging, encryption, batch, async, net10 |
| 69 | + - License: MIT |
| 70 | + |
| 71 | +## Publishing to NuGet.org |
| 72 | + |
| 73 | +```bash |
| 74 | +dotnet nuget push bin\Release\SharpCoreDB.Serilog.Sinks.1.0.0.nupkg ` |
| 75 | + --source https://api.nuget.org/v3/index.json ` |
| 76 | + --api-key YOUR_API_KEY |
| 77 | +``` |
| 78 | + |
| 79 | +**Get API key**: https://www.nuget.org/account/apikeys |
| 80 | + |
| 81 | +## Package Structure |
| 82 | + |
| 83 | +``` |
| 84 | +SharpCoreDB.Serilog.Sinks.1.0.0.nupkg |
| 85 | +??? SharpCoreDB.jpg # Logo |
| 86 | +??? README.md # Documentation |
| 87 | +??? lib/ |
| 88 | +? ??? net10.0/ |
| 89 | +? ??? SharpCoreDB.Serilog.Sinks.dll # Assembly |
| 90 | +? ??? SharpCoreDB.Serilog.Sinks.xml # XML documentation |
| 91 | +??? .signature.p7s # NuGet signature |
| 92 | +``` |
| 93 | + |
| 94 | +## Troubleshooting |
| 95 | + |
| 96 | +### Logo Not Included |
| 97 | + |
| 98 | +If the logo is missing from the package: |
| 99 | + |
| 100 | +1. Check if `SharpCoreDB.jpg` exists in `..SharpCoreDB\` folder |
| 101 | +2. If missing, either: |
| 102 | + - Add the logo file to the SharpCoreDB project |
| 103 | + - Or copy it to `SharpCoreDB.Serilog.Sinks\SharpCoreDB.jpg` |
| 104 | + - Update `.csproj`: |
| 105 | + ```xml |
| 106 | + <None Include="SharpCoreDB.jpg" Pack="true" PackagePath="/" /> |
| 107 | + ``` |
| 108 | + |
| 109 | +### README Not Displaying on NuGet.org |
| 110 | + |
| 111 | +If README doesn't show: |
| 112 | +- Ensure `PackageReadmeFile` is set in `.csproj` |
| 113 | +- Verify `README.md` is included in package (check with Package Explorer) |
| 114 | +- NuGet.org may take a few minutes to process and display README |
| 115 | + |
| 116 | +### Logo Not Displaying on NuGet.org |
| 117 | + |
| 118 | +If logo doesn't show: |
| 119 | +- Ensure `PackageIcon` is set in `.csproj` |
| 120 | +- Verify `SharpCoreDB.jpg` is in package root (not in subdirectory) |
| 121 | +- Logo must be JPEG or PNG format |
| 122 | +- Recommended size: 128x128 to 200x200 pixels |
| 123 | +- NuGet.org caches images - may take up to 1 hour to update |
| 124 | + |
| 125 | +## Best Practices |
| 126 | + |
| 127 | +1. **Logo Dimensions**: Keep logo square (200x200 recommended) |
| 128 | +2. **Logo Size**: Keep under 1MB (ideally under 100KB) |
| 129 | +3. **Logo Format**: Use JPEG or PNG |
| 130 | +4. **README**: Keep concise with practical examples |
| 131 | +5. **Version**: Use semantic versioning (1.0.0, 1.0.1, etc.) |
| 132 | +6. **Tags**: Use relevant keywords for discoverability |
| 133 | +7. **Documentation**: Always include XML documentation comments |
| 134 | + |
| 135 | +## Updates |
| 136 | + |
| 137 | +To update logo or README after publishing: |
| 138 | + |
| 139 | +1. Update the files locally |
| 140 | +2. Increment version number in `.csproj` |
| 141 | +3. Rebuild and pack |
| 142 | +4. Push new version to NuGet.org |
| 143 | + |
| 144 | +**Note**: You cannot replace an existing version on NuGet.org. Always increment the version number. |
| 145 | + |
| 146 | +## Example NuGet Package Page |
| 147 | + |
| 148 | +When published, your package page will look like: |
| 149 | + |
| 150 | +``` |
| 151 | +??????????????????????????????????????????? |
| 152 | +? [SharpCoreDB Logo] ? |
| 153 | +? ? |
| 154 | +? SharpCoreDB.Serilog.Sinks ? |
| 155 | +? v1.0.0 ? |
| 156 | +? ? |
| 157 | +? A Serilog sink for SharpCoreDB... ? |
| 158 | +? ? |
| 159 | +? Install: ? |
| 160 | +? dotnet add package SharpCoreDB... ? |
| 161 | +? ? |
| 162 | +? [README TAB] [Dependencies] [Versions] ? |
| 163 | +? ? |
| 164 | +? Full README.md content displays here... ? |
| 165 | +??????????????????????????????????????????? |
| 166 | +``` |
| 167 | +
|
| 168 | +## Additional Resources |
| 169 | +
|
| 170 | +- **NuGet Docs**: https://docs.microsoft.com/nuget/ |
| 171 | +- **Package Icon Guide**: https://docs.microsoft.com/nuget/reference/nuspec#icon |
| 172 | +- **Package README**: https://docs.microsoft.com/nuget/nuget-org/package-readme-on-nuget-org |
| 173 | +- **SharpCoreDB Repo**: https://github.com/MPCoreDeveloper/SharpCoreDB |
| 174 | +
|
| 175 | +--- |
| 176 | +
|
| 177 | +**Status**: ? Package configuration complete with logo support |
| 178 | +**Ready to publish**: Yes |
| 179 | +**Logo included**: Yes (via reference to main project) |
| 180 | +**README included**: Yes |
| 181 | +**XML documentation**: Yes |
0 commit comments