Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - project shows up as "Miscellaneous Files"

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 code editor shows that it belongs to 'Miscellaneous Files'.

Screenshot of the problem

Other symptoms: if I go to the properties of the project and look at Assembly Information, all values are blank, despite the values existing in the AssemblyInfo.cs file.

Both of these are annoying, but the problem is that

  • I don't get intellisense on any files in the project
  • I can't seem to step through it in the debugger (it tells me that the files do not belong to the solution and so can't be debugged).

Assembly info is blank

I have tried:

  • Combing through the .csproj file and comparing to others in the solution (no joy)
  • Re-creating the .csproj file and overwriting the old one (worked until I merged the branch into trunk, then the problem re-appeared)
  • Banging my head on the keyboard (headache)

Google has turned up nothing. Does anyone have any ideas as to what's going on here?

like image 731
Keith Williams Avatar asked Jun 17 '14 08:06

Keith Williams


People also ask

What is miscellaneous project?

When a user opens project items, the IDE assigns to the Miscellaneous Files project any items that are not members of any projects in a solution. Projects play a significant role in determining which editor is used when a user opens a project item.


1 Answers

How I solved my issue:

  1. Go to the file which appears as Miscellaneous Files inside Solution Explorer.
  2. Right-Click file and select Exclude from project.
  3. Right-Click your project/folder where the file was and click add Existing Item, and add the file you just removed back into your project.
like image 160
KING Avatar answered Oct 08 '22 21:10

KING