In this tutorial, you will learn how to fix the CS1519: Invalid token ',' in class, struct, or interface member declaration error. This post is brief, however, it will hopefully save someone out there an hour or two of debugging! Recently, during deployment and I came across this error:

CS1519: Invalid token ',' in class, struct, or interface member declaration error

I tried all the usual fixes. An IISREST, clean the temp .NET files, a reboot of my PC, however, nothing worked until I realized what had happened... I did some cleaning on the server and had 'cleaned' the 'Bin' folder. When I did my next deployment, some of the core Episerver CMS assemblies had not been copied over correctly because some of the assemblies had copy local set to true. Note, this error occurred before Nuget when Episerver used to be installed via an installer. When I did my deployment, the Episerver core assemblies were missing and the error occurred. If you encounter this error, make sure you have all your core Episerver DLL's included in your build! Sometimes you may see this error if your build has failed. When you see this error, think something is likely missing from the bin folder. Look in your bin folder and make sure all the core Episerver assemblies exist. Hope this help. Happy Coding 🤘