Why do I receive this error when loading a solution in Runtime: Cannot cast type X to type X?
When loading a project in Runtime onto a workstation with both Studio and Runtime installed, you receive this error:
Cannot cast type X to type X.
This error can occur when loading a project in Runtime that uses a third-party DLL file and that DLL file is present in both the Studio program folder (C:\Program Files\OpenSpan\OpenSpan Studio) and the deployment package. The problem appears to be caused by .NET loading both copies of the file into memory and treating them as different assemblies.
To avoid this issue, remove the the DLL file from the Studio program folder and leave the copy in the deployment package. Leaving a copy of the DLL file in the deployment package lets you test the solution in the deployment environment.
Note: This error will only occur on machines that have both Studio and Runtime installed.