This is a weird one. I have a C# Class Library project within my solution. If I open a .cs file within this project, the Project drop-down on the c
If it's not showing up in your Solution Explorer, try clicking the "Show All Files" button at the top of Solution Explorer. If the files become visible and are located under the project you expect them to be in, but the file still has "Miscellaneous" listed as its project, then right click the files and select "Include in Project". Otherwise try dragging them to the proper project.
I just hit this issue in VS 2017 and this is what worked for me.