Orleans serialization encountered pit

Really huge pit

I do understand the problem simply no words to describe my feelings

First composition shelves

Ideal architecture

Services casually on the gateway is only responsible for distribution

Then follow the official tutorial written a series of problems encountered

Previous experience, do not panic, before sleepwalk to get.

And then encountered a matter of crash

One or more errors occurred. (Named type "Entity.BookCategory" is invalid: Type string "Entity.BookCategory" cannot be resolved.) ---> System.TypeAccessException: Named type "Entity.BookCategory"

This self Entity.BookCategory replaced by an entity class file name

Word description appears in the middle too little

Is a one descriptor is invalid: Type string little to do with the eggs puzzled

Then noticed the error class is System.

TypeAccessException

The exception that is thrown when a method attempts to use a type that it does not have access to.

 

Translation is no exception thrown access

 

Look ignorant force

Entity is the foundation of the library we have cited

Gateway does not refer only

So Entity reference library

This solution is given on Github Gangster

At first I was the first to use the solution

Install two Nuget in Gateway, is not resolved

.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(BookCategory).Assembly).WithReferences())

Then into a third method, eh running the

Not happy for a while.

I made a test,

Gateway start

修改服务逻辑 添加新的类

启动服务与客户端

问题又出来了

这可真是叫人绝望啊

意味着每一次新增实体都要重启网关。

这是在逗我?

 

也大概能猜到为什么

Orleans是预编译

他在程序启动的时候执行扫包,编码,生成类文件

新增的实体没有被生成类文件。

当然没有权限访问,因为根本不存在。

Guess you like

Origin www.cnblogs.com/AnAng/p/11040216.html