If this exception is encountered when using NServiceBus in an ASP.NET application after upgrading the code of the app, it is usually due to files that are locked.
Server Error in '/' Application. Type XYZ was not registered in the serializer. Check that it appears in the list of configured assemblies/types to scan. Description: An unhandled exception occurred during the execution of the current web request. Review the stack trace for more information about the error and where it originated in the code.
- Stop the w3svc process of the website being upgraded.
- Delete temporary ASP.NET files, usually found in the directory
- Run the application again. The exception should no longer happen.