Code Monkey home page Code Monkey logo

Comments (9)

SoucianceEqdamRashti avatar SoucianceEqdamRashti commented on June 7, 2024

@ReubenBond , I believe the issue here is that we have moved our types to a class library. Now Orleans cannot find the types in the assembly anymore even though the main project references the class library. Do we need to explicitly add the class library assembly similar to what has been mentioned in other issues like [assembly: GenerateCodeForDeclaringAssembly(typeof(SomeTypeInMyOtherAssembly))] . We are on version 7.2.1 and the only change we have done in our code is move the grain types (records) from the main project to a class library. All the types of have generate serializer and alias attributes.

from orleans.

ledjon-behluli avatar ledjon-behluli commented on June 7, 2024

@SoucianceEqdamRashti the issue is not moving types to a class lib, the issue is that Alias doesn't apply to the OrleansJsonSerializer

from orleans.

SoucianceEqdamRashti avatar SoucianceEqdamRashti commented on June 7, 2024

@ledjon-behluli , can you elaborate on that? Are you saying I need to explicitly add the new NewtonSoft.Json package to the class library?

To give more context, in the initial setup, everything existed in one project and this worked fine. We created creates in Azure table storage and no issues there. Then we decided to move the models to a class library and that's when we got the issue of the types not being found and also codec not found for a json serializer exception.

from orleans.

ledjon-behluli avatar ledjon-behluli commented on June 7, 2024

@SoucianceEqdamRashti maybe we are talking about two different things, but can you tell me if in the "$type" property, stored in table storage, you had the fully qualified name or not, i mean in the previous setup you had.

from orleans.

ledjon-behluli avatar ledjon-behluli commented on June 7, 2024

Ah, i looked at your initial comment and as you can see the FQN is stored in $type. See: $type":"TIP.AutomationCenter.Orleans.**Api**.Grains.Contracts.ActionReason.ActionReasonTriggerConditionRecord.

Now the namespace changed to: TIP.AutomationCenter.Orleans.**Business**.Grains.Contracts.Country

from orleans.

SoucianceEqdamRashti avatar SoucianceEqdamRashti commented on June 7, 2024

@ledjon-behluli , yeah the namespace changed initially.

But I also tried to keep the same namespace in the new class library but that didn't make any difference. Got the same error as above. My assumption is that with Alias it shouldn't use the full name to access the types?

from orleans.

ledjon-behluli avatar ledjon-behluli commented on June 7, 2024

@SoucianceEqdamRashti I dont know about keeping the namespace the same, i would assume it would work (regardless of Alias or not), in the otherhand i dont know if 2 types with the same namespace can be deserialized if assembly info is taking into account or not. You could try this with a POC project and just use Newtonsoft.Json to try it out.

Regarding Alias in the context of storage: no it doesnt work! Kinda...See the Alias attribute is used with the Orleans serializer (the default RPC is done with), not with others! And the json serializer (deafult one for storage) doesnt take that into account (so far). You could use the orleans serializer for storage too, and it should work then. I am not sure if you want to do that, since you'll gain this ability but loose readability, and in-place modification...potentially other benefits.

Hope this helps.

from orleans.

SoucianceEqdamRashti avatar SoucianceEqdamRashti commented on June 7, 2024

Hmm, thanks for the clarification. Perhaps we will just keep the code in one project for now until some of these serializer parts become easier. Thanks again. I will though try with a POC and if anything new comes up I will post it here. Can close this issue for now.

from orleans.

ledjon-behluli avatar ledjon-behluli commented on June 7, 2024

I will though try with a POC and if anything new comes up I will post it here

Please, and @ me if you dont mind

from orleans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.