Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
639 views
in Technique[技术] by (71.8m points)

c# - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...