Skip to content

Commit 8dded27

Browse files
committed
Update readme
1 parent b69753b commit 8dded27

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

README.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,42 @@ This library is faster than the official implementation because it uses unsafe c
174174
2. **Do not use** the writer after disposing the allocator. When using `LibProtoZeroSharp.Debug` you will get managed exceptions, but in release mode, you will get segmentation faults!
175175
3. **Do not use** the generated structures after disposing the allocator. No matter if you use debug or release mode, you will get segmentation faults!
176176
4. You may copy the generated structures, but remember that they are just a shallow copy. And you may not use them after disposing the allocator.
177-
5. **Do not copy** the allocator! It is a struct and copying it will lead to bugs. Always pass it by `ref`.
177+
5. **Do not copy** the allocator! It is a struct and copying it will lead to bugs. Always pass it by `ref`.
178+
179+
## Nuget
180+
181+
This library is available on Nuget:
182+
183+
```
184+
<PackageReference Include="ProtobufZeroSharp" Version="0.5.0" />
185+
```
186+
187+
This is a Release-mode library with commented out safety checks, so that it is faster, but also potential misusage (i.e. ReadMessage when the current tag is a varint) may lead to segmentation faults. Include `ProtobufZeroSharp.Debug` package for additional safety checks.
188+
189+
```
190+
<PackageReference Include="ProtobufZeroSharp.Debug" Version="0.5.0" />
191+
```
192+
193+
You can also include those packages depending on your configuration:
194+
195+
```
196+
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
197+
<PackageReference Include="ProtobufZeroSharp.Debug" Version="0.5.0" />
198+
</ItemGroup>
199+
200+
<ItemGroup Condition="'$(Configuration)' != 'Debug'">
201+
<PackageReference Include="ProtobufZeroSharp" Version="0.5.0" />
202+
</ItemGroup>
203+
```
204+
205+
For the source generator, include
206+
```
207+
<PackageReference Include="ProtobufZero.Generator" Version="0.5.0.1" />
208+
```
209+
210+
And add your .proto files to the project as AdditionalFiles.
211+
```xml
212+
<ItemGroup>
213+
<AdditionalFiles Include="structures.proto" />
214+
</ItemGroup>
215+
```

0 commit comments

Comments
 (0)