Visual Studio - project shows up as “Miscellaneous Files”

后端 未结 13 1842
走了就别回头了
走了就别回头了 2020-12-01 11:50

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

相关标签:
13条回答
  • 2020-12-01 12:20

    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.

    0 讨论(0)
  • 2020-12-01 12:21

    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.

    0 讨论(0)
  • 2020-12-01 12:22

    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.

    0 讨论(0)
  • 2020-12-01 12:24

    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

    0 讨论(0)
  • 2020-12-01 12:25

    In VS2017, I was able to fix this issue by deleting *.vs folder and *.user files

    0 讨论(0)
  • 2020-12-01 12:25

    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.

    0 讨论(0)
提交回复
热议问题