简体   繁体   中英

Why doesn't Intellisense work in VS2010 when I use wildcards in my .csproj file?

Steps to reproduce:

  1. Create a new C# console project.
  2. Write some code:

     class Foo { } class Bar { Foo x; } 
  3. Observe that in Foo x; the class name is highlighted. Intellisense will work for classes in this assembly.
  4. Edit the .csproj file to include "**\\*.cs" instead of "Program.cs", to include all .cs files in the project directory and its subdirectories.
  5. Reload the project when prompted.
  6. Observe that the C# file is still loaded and part of the project, but that Intellisense and syntax highlighting no longer recognise any types declared in this assembly or in 3rd party assemblies that are not installed in the GAC.

Why does this happen? I would like to use wildcards to make it easier to add new files outside of the Visual Studio IDE.

I still don't know why this happens, but I did find out how to fix it: replace **\\*.cs with .\\**\\*.cs and as if by magic, it all works. Hope that helps somebody else!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM