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
Due to TypeScript, check that your file matches to pattern, specified in tsconfig.json file in "include" section. If .ts file not inculded by tsconfig, then intellicense will show it as Miscellaneous.
Somehow I solved this by going to properties (Right-click the file and select Properties). The Build Action was set to Content. Just change it to Compile and problem solved.
I have this issue in VS 2017 also.
I found that this miscellaneous
files are files added outside the VS. So if switch to another git branch (where there are new files) whithout closing the VS and click to "Reload" button in VS (when it checks that sln/csproj files are modified outside the VS) then these new files are not correctly parsed by VS and "marked" as miscellaneous
.
As workaround I close VS, remove folder .vs
from disk and run VS again. After VS will fully initialized these new files are parsed successfully.
Note this way clears you custom settings like StartUp Project
and so on.
If this is still an issue you might check through your Nuget packages. By default in VS 2017 some projects would include references to various compiler libraries from Microsoft. These almost certainly aren't needed. In my case removing them immediately resolved the miscellaneous files issue.
I can't recall which Nugets exactly but I am pretty sure one of them was - Microsoft.CodeDom.Providers.DotNetCompilerPlatform
In VS2017, I was able to fix this issue by deleting *.vs folder and *.user files
I had exactly the same problem and it turned out that some of the XAML files in my project were set to be built using the action 'XamlAppDef' (ie build it as a XAML Workflow) and when I turned it back to 'Compile', my Project dropdown instantly went from (Miscellaneous files) to the correct project.