1,802 questions
2
votes
1
answer
92
views
Serialization of nullable immutable array
I seem to be having trouble serializing a Nullable, ImmutableArray which I had thought would work out of the box.
e.g.,
void Main()
{
var x = new Test() { Field = null };
var stream = new ...
1
vote
1
answer
92
views
Callback methods with ProtoBeforeSerialization/ProtoAfterDeserialization donot work in protobuf-net 3.2.26, even when assigned explicitly to MetaType
I'm upgrading from protobuf-net 2.2.1.0 to 3.2.26, and I've noticed that callback methods decorated with [ProtoBeforeSerialization] and [ProtoAfterDeserialization] are no longer invoked during ...
1
vote
1
answer
80
views
How do I set up automatic class generation from a contract using protobuf-net?
I configured the .csproj file as follows:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>...
1
vote
1
answer
132
views
ASP.NET Core 8 grpc Import "annotations.proto" not found
I have an ASP.NET Core 8 project and followed this article:
https://learn.microsoft.com/en-us/aspnet/core/grpc/json-transcoding-binding?view=aspnetcore-8.0
import "google/api/annotations.proto&...
0
votes
1
answer
47
views
Conditional Merge in Protobuf-Net
I have some very specific requirements for a serialization C# library: I need it be able to handle circular references or multiple references to the same object, be capable of deserializing into an ...
1
vote
0
answers
85
views
Serialization/deserialization by reference
I'm using Protobuf-net version 3.2.52
Classes B, C and D below contain a field of type Wplane, all of which have the same instance.
In the WPlane class, I transform the Plane property (this type comes ...
0
votes
0
answers
55
views
Protobuf-net unexpected method call
I'm using Protobuf-net version 3.2.52
During deserialization, a method call occurs unexpectedly.
How can Protobuf call this method when it's only referenced 15 times in the entire solution and I've ...
0
votes
1
answer
86
views
Protobuf-net recursion exception
I'm using Protobuf-net version 3.2.52
While serializing, I get this exception:
Possible recursion detected (offset: 3 level(s)): Loop_Protobuf.Core_E.Part
I've read all the posts about this error on ...
0
votes
1
answer
42
views
ProtoInclude on derived classes that inherit from class libraries
I have the following inheritance structure:
[ProtoContract]
public class User : UserCommon<User, Database.User>
[ProtoContract]
public abstract partial class UserCommon<T, T2> : ...
0
votes
0
answers
37
views
WPF acces to namespace protobuf-net libraries from a library which using protobuf-net libraries
I have a WPF library (myLibrary) that uses the protobuf-net libraries. The protobuf-net libraries are in a subfolder.
I'm doing this because another nuget package references protobuf-net but with an ...
0
votes
0
answers
38
views
Serialize an object that implements IEnumerable<T> with Protobuf.net [duplicate]
I am trying to serialize the following class with the latest version of Protobuf.net:
[ProtoContract(SkipConstructor = true)]
public class ObservableList<T> : IEnumerable<T>
{
[...
0
votes
0
answers
60
views
protobuf-net serialize object array when it only contains known types (int, string, decimal, etc.)
Maybe this is a nobrainer.
I have a tabular data structure where each row is represented by an object[]. The data structure implements ITypedList so I can even tell the exact type of each object in ...
0
votes
1
answer
71
views
Azure PubSub with protobuf data not working
I am using generic WebSocket client (System.Net.WebSockets) to connect to Azure Web PubSub service and communicate between two parties.
I referred this official document. I was able to communicate ...
1
vote
1
answer
77
views
DynamicData doesn't populate correctly test data when using grpc objects
I use Visual Studio 2022 and MS Test. To generate code from proto file I use Grpc.Tools (2.69.0) and Google.Protobuf (3.29.3) nugets.
I don't know how DynamicData feature works under the hood, but it ...
0
votes
0
answers
105
views
Converting FHIR Json to Google proto generated model
We have the FHIR JSON model which needs to be serialized using protobuf but we are not able to serialize it as the JSON is not getting parsed to the generated google fhir models.
https://github.com/...
0
votes
0
answers
92
views
How to deserialize protobuf message containing bytes to C# objct
I'm using c#.net cote 8.0. I have a protobuf object
syntax = "proto3";
option csharp_namespace = "Application.Messages";
message ApplicationConfig {
string domain = 1;
int32 ...
1
vote
1
answer
94
views
Unable to test code-first gRPC service using AddCodeFirstGrpcClient and WebApplicationFactory
I'm trying to take advantage of Protobuf-net's client factory method AddCodeFirstGrpcClient to create client in a testing context using WebApplicationFactory<TEntryPoint>.
The issue is with the ...
1
vote
1
answer
207
views
Inter process communication with protobuf-net.grpc (NET48 NET8)
I'm trying to establish interprocess communication between .net framework (4.8) and .net (8) with protobuf-net.grpc.
The communication between client/server in .net 8 works according to the ...
0
votes
0
answers
99
views
Protobuf net 3.2.30 nuget requires 2 versions of System.Runtime.CompilerServices.Unsafe.dll i.e. 6.0.0 and 4.5.3. How to ship these libraries or fix?
System.Collections.Immutable
7.0.0
is dependent on
<dependency id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" exclude="Build,Analyzers" />
and
System....
0
votes
0
answers
55
views
In Compile Time after deserialized some values are null in Protobuff-net
Recently we changed our serializer and deserializer to Protobuff-net from BinaryFormatter.
In this, I'm facing some problems, after deserializing some of the values are still getting as null.
The Core....
1
vote
1
answer
132
views
Why ProtoInclude necessary for Parent class
I'm new to the this Protobuf.net,
we have many classes and it is inherited with parent classes, some times it is multi-level inherited.
we can't add [ProtoInclude()] everywhere.
I don't know we really ...
1
vote
0
answers
214
views
Error: Merge an unknown field of end-group tag, indicating that the corresponding start-group was missing
I am trying to consume Kafka messages using C# but getting an error:
Merge an unknown field of end-group tag, indicating that the corresponding start-group was missing.
When I try to save these ...
-1
votes
1
answer
50
views
WPF DataGrid not sorting Google.Protobuf.WellKnownTypes.Timestamp column
I have a DataGrid with auto-generated columns and data context bound to a protobuf class. The protobuf class is auto-generated and one of its properties is of type Timestamp. Others are just plain ...
0
votes
0
answers
89
views
After deserializing some values getting in Protobuff-net
In our .NET application, the classes are generated dynamically and it has multi-level inheritance.
We are facing problems - after deserializing ProtoContract class some values are set to null (we are ...
1
vote
1
answer
312
views
Deserialization of protobuf
I have a .proto file that I have traditionally been using with protogen.exe to generate a .cs file for the relevant class. The class generated implements Protobuf.IExtensible. However, I now need to ...
0
votes
0
answers
279
views
ASP.NET Core 8.0 Web API : integration tests not working with gRPC
I have a Web API written with ASP.NET Core 8.0, and it's configured to work with Http1 and Http2:
"Kestrel": {
"EndpointDefaults": {
"Protocols": "...
1
vote
1
answer
177
views
Generate protobuf files from C# classes?
I have a C# GRPC library that I am converting, I have complex protobuf-net objects (defined in C#) using features like inheritance. How can I convert these objects to native .proto files? If possible, ...
0
votes
0
answers
68
views
Strange gRPC Issue on iOS for Blazor MAUI Hybrid
We are using gRPC in our app and it works great, now suddenly we got the error below on iOS, the exact same code works great on Android and Windows. The error:
TypeInitialization_Type, ...
0
votes
0
answers
56
views
unexpected sub-type for interface
I have an interface, and I can serialize a class that has that as a member.
Ie, this works:
static void testSerializeInterface()
{
var ai = new anImplemntation();
ai.aVal = 101;...
0
votes
1
answer
343
views
How can I securize my code-first gRPC endpoints using Azure Authentication?
I'm building a microservice. I have some working REST endpoints securized by JWT generated by Microsoft Azure. Here is how the token is verified :
builder.Services
.AddAuthentication(...
0
votes
1
answer
270
views
Import "google/protobuf/Timestamp.proto" was not found or had errors. in .net 8
When I run:
dotnet publish -c Release -o out
I get:
google/protobuf/Timestamp.proto : error : File not found. [/app/StorageService.GRPC.Server/StorageService.GRPC.Server.csproj]
Protos/candidate....
0
votes
1
answer
95
views
How to generate the your-class.proto from C# object with decorators
I'm using protobuf-net to serial/deserialize the data to work with my Kafka cluster.
Is there any way to generate the class-name.proto from the C# class with decorators like the one below?
Thanks
...
0
votes
0
answers
90
views
How to use Interface as [DataMember] in protobuf-net.Grpc.AspNetCore
I'm working on a .NET project where I need to use Protobuf and gRPC for serialization and communication. My classes use interfaces and the [DataContract] attribute. I'm having trouble getting ...
1
vote
2
answers
112
views
Time data '2024-05' does not match format '%Y-%m-%dT%H:%M:%S' (Protobuff)
I am creating a protobuffer from a json and json strcture loooks like this:
{
"answerUpdateRequest": {
"entity": {
"type": "ORGANIZATION&...
0
votes
1
answer
260
views
How would I write a custom protobuf-net serializer for this particular class
I am trying to write a custom protobuf-net serializer to put a property of type object to the wire.
[ProtoContract(Serializer=typeof(ChangeRecordSerializer))]
public class ChangeRecord
{
public ...
1
vote
1
answer
239
views
How to write a custom ISerializer in protobuf-net
I am in the middle of converting serialization in our huge project from BinarySerializers to ProtoBuf, using protobuf-net library.
I have some classes where members have the type object, which needs ...
0
votes
2
answers
203
views
Protobuf Compiler Error When There's a Period in the csharp_namespace Value
I am trying to add my protos to an existing common library so my clients and servers can import it and stay in sync with any changes.
I added Grpc.AspNetCore, Google.Protobuf, and Grpc.Tools to the ...
0
votes
0
answers
286
views
For C# and gRPC, which is the difference between protobuf-net and protobuf-net.Grpc?
Until now, I was using protobuf-netGrpc to use gPRC to transmit data between service and client. It works, I can create an interface as contract between the service and the client and I can use ...
2
votes
1
answer
238
views
Can't use struct in protobuf-net
public struct Candle //88 bytes struct
{
[DataMember(Order = 1)] public long TimeStamp { get; }
[DataMember(Order = 2)] public decimal Open { get; }
[DataMember(Order = 3)] public ...
0
votes
0
answers
61
views
Interoperability issue between Protobuf enabled WCF service and client with different version of Protobuf-net library
I'm new to WCF and Protobuf. So recently I upgraded the version of protobuf library used in our WCF service to version 3.0.101. I've a WCF client which uses an older version of Protobuf library, 2.0.0....
0
votes
0
answers
954
views
Is it possible to return null value with gRPC protobuf-net?
I am using gRPC protobuf-net to facilitate communication between a client application and a service.
The client can send a command to retrieve an entity by its ID. On the server side, the service ...
1
vote
0
answers
122
views
Unable to establish two way communications using named pipes and Protobuf in .NET
Starting from https://johnkoerner.com/csharp/IPC-in-net-core-using-protobuf/, I am trying to establish a two-way communication.
I have also seen this SO post on the subject, but still I cannot make it ...
1
vote
1
answer
49
views
DotNetBrowser has hard dependency on protobuf-net version 2.4.0.0
It seems there is a hard runtime dependency on protobuf-net version 2.4.0.0 despite the Nuget package declaring the dependency as >= 2.4.0.0. I need version 3.2.30 in my app.
0
votes
0
answers
264
views
How to assign System.Type and object values from c#.net to protobuf
google.protobuf.Type Type = 1;
Using below code I am trying to assign the value which is system.type to WellKnownTypes.Type.
scanParameter.Type = (Google.Protobuf.WellKnownTypes.Type)parameter....
0
votes
0
answers
384
views
C# gRPC code first API streaming from client
Need a little help. I am using code first approach to gRPC. Here is my service definition:
[ServiceContract]
public interface IFileStorageService
{
[OperationContract]
Task<...
2
votes
0
answers
46
views
Is it possible to maintain backward compatibility with DynamicType in protobuf-net?
We recently made the decision to update the version of protobuf-net used in some projects.
With the update we noticed that the Dynamic Type feature was discontinued.
We would like to continue using ...
0
votes
1
answer
90
views
Does Protobuf-net connect over Internet for performing some checks?
We use the library protobuf-net in our project and based on a customer request we are trying to figure out If the library communicates over to Internet any time during the course of operations?
It ...
0
votes
1
answer
390
views
Protobuf.net How to deserialize array of int (packed data)
We are using protobuf to make several systems inter-communicate. Some of them use protobuf.net, some use other languages and libraries.
Our application-level messages consist of a header and a body.
...
1
vote
0
answers
39
views
is it possible to send a custom exception from the server to the client with protobuf-net?
I have some customs exceptions that I am using to use the same exceptions in all the layers of the application, so sometimes I need to pass an exception from the server to the client. For example, ...
-1
votes
1
answer
56
views
How does protobuf2 communicate with protobuf-net
In my project I use protobuf c for the server and protobuf-net for the client. But protobuf c cannot decode classes where the client uses the "ProtoInclude" attribute.
This is the client ...