开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜