NServiceBus - Type was not registered in the serializer - Fix?

匆匆过客 提交于 2019-12-23 13:00:04

问题


We are using NServiceBus in a web application and each time we deploy our code to production, we have to delete the Temporary Files in the folder:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

We are following the instructions here to fix this:

http://www.nservicebus.com/faq/TypeNotRegisteredInSerializer.aspx

I was wondering if there is a more permanent fix to this? I feel like I am fighting with this every time I deploy new code. What is the best way to handle this from code? If that doesn't work, is it best to just stop the application pools, delete the files, and restart the app pools every time I deploy new code?

Thanks for any advice.


回答1:


Instead of using Configure.WithWeb(), try instead:

Configure.With(HttpRuntime.BinDirectory)

That way, it will search the actual bin folder in your deployed web application instead of the temporary folder. This is also the default behavior in nservicebus 3.0.




回答2:


We've hit this too. Haven't found anything better than stopping the app pools, deleting the temp asp.net files and then restarting.




回答3:


What is the solution if you have some assemblies that should be ignored. We have something like this:

_bus = Configure.With(AllAssemblies.Except("IncompatibleAssembly.dll"))


来源:https://stackoverflow.com/questions/6523025/nservicebus-type-was-not-registered-in-the-serializer-fix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!