Category / Section
Invalid cast exception was unhandled while upgrading projects
1 min read
Resolve ‘Invalid cast exception’
To resolve the invalid cast exception:
- Ensure that the respective Syncfusion version assemblies exist in the GAC location. For 2.0 and 3.5 assemblies, check C:\Windows\assembly. For 4.0 assemblies, check C:\Windows\Microsoft.NET\assembly\GAC_MSIL\. Otherwise, run the Assembly Manager utility from the Syncfusion dashboard to install latest version assemblies into the GAC. The Assembly Manager can be opened from the Start menu by selecting Start > Programs > Syncfusion > Essential Studio x.x.x.x > Dashboard > Utilities > Assembly Management > Assembly Manager. a. Set the assembly type as prebuilt version of assemblies. b. Set the action as Install version x.x.x.x. c. For the framework, select All. d. Click Perform Action.
- Ensure that the assemblies referred to in the project all belong to the same Syncfusion version (e.g., all belong to v10.4.0.71).
- Set the Copy Local and Specific version properties as True for all the Syncfusion assemblies referred to in the project.
- Delete the bin and obj folders from the project location. Rebuild and run the project.