问题
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