关于.net:为什么VS 2005不断给我“ x”在命名空间“ y”中的含义不明确?

关于.net:为什么VS 2005不断给我“ x”在命名空间“ y”中的含义不明确?

Why does VS 2005 keep giving me the “'x' is ambiguous in the namespace 'y'” error?

赏金:我将通过贝宝(Paypal)发送5美元,以为我解决该问题。

我不确定我更改了哪个VS设置,或者它是web.config设置还是什么,但是我一直在错误列表中看到此错误,但是所有解决方案都可以正常运行。 这里有些例子:

1
2
3
4
5
6
7
8
9
10
Error   5   'CompilerGlobalScopeAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'. C:\projects\MyProject\Web\Controls\EmailStory.ascx  609 184 C:\...\Web\
Error   6   'ArrayList' is ambiguous in the namespace 'System.Collections'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb   13  28  C:\...\Web\
Error   7   'Exception' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb   37  21  C:\...\Web\
Error   8   'EventArgs' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb   47  64  C:\...\Web\
Error   9   'EventArgs' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb   140 72  C:\...\Web\
Error   10  'Array' is ambiguous in the namespace 'System'. C:\projects\MyProject\Web\Controls\EmailStory.ascx.vb   147 35  C:\...\Web\

    [...etc...]

Error   90  'DateTime' is ambiguous in the namespace 'System'.  C:\projects\MyProject\Web\App_Code\XsltHelperFunctions.vb   13  8   C:\...\Web\

可以想象,这真令人讨厌,因为代码中到处都有蓝色的波浪状下划线,并且几乎不可能过滤掉"错误列表"窗格中的相关错误。 我检查了默认的ASP.Net web.config和machine.config,但似乎什么都没有。

编辑:这是发生错误的一些来源:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'Error #5: whole line is blue underlined'
<%= addEmailToList.ToolTip %>

'Error #6: ArrayList is blue underlined'
Private _emails As New ArrayList()

'Error #7: Exception is blue underlined'
Catch ex As Exception

'Error #8: System.EventArgs is blue underlined'
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'Error #9: System.EventArgs is blue underlined'
Protected Sub sendMessage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles sendMessage.Click

'Error #10: Array is blue underlined'
Me.emailSentTo.Text = Array.Join(";", mailToAddresses)

'Error #90: DateTime is blue underlined'
If DateTime.TryParse(data, dateValue) Then

编辑:GacUtil结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil -l mscorlib

Microsoft (R) .NET Global Assembly Cache Utility.  Version 1.1.4318.0
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

The Global Assembly Cache contains the following assemblies:

The cache of ngen files contains the following entries:
        mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c5619
34e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d003700430039004
40037004500430036000000
        mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c5619
34e089, Custom=5a00410050002d004e0035002e0031002d0038004600440053002d00370043003
900450036003100370035000000

Number of items = 2
1
2
3
4
5
6
7
8
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" -l mscorlib

Microsoft (R) .NET Global Assembly Cache Utility.  Version 2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:

Number of items = 0

编辑:来自ngen的有趣结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
gen display mscorlib /verbose

Microsoft (R) CLR Native Image Generator - Version 2.0.50727.832
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

NGEN Roots:

mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d00330037004200430043003300430035000000
    ScenarioDefault
        mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d00330037004200430043003300430035000000
            DisplayName = mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
            Native image = {7681CE0F-F0E7-F03A-2B56-96345589D82B}
            Hard Dependencies:
            Soft Dependencies:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    ScenarioNoDependencies
        mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
            DisplayName = mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
            Native image = {7681CE0F-F0E7-F03A-2B56-96345589D82B}
            Hard Dependencies:
            Soft Dependencies:

NGEN Roots that depend on"mscorlib":
[...a bunch of stuff...]

Native Images:

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Source MVID:    {D34102CF-2ABF-4004-8B42-2859D8FF27F3}
    Source HASH:    bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec
    NGen GUID sign: {7681CE0F-F0E7-F03A-2B56-96345589D82B}
    OS:     WinNT
    Processor:  x86(Pentium 4) (features: 00008001)
    Runtime:    2.0.50727.832
    mscorwks.dll:   TimeStamp=461F2E2A, CheckSum=00566DC9
    Flags:      
    Scenarios:      <no debug info> <no debugger> <no profiler> <no instrumentation>
    Granted set:    <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

    File:      

C:\WINDOWS\assembly
ativeImages_v2.0.50727_32\mscorlib\0fce8176e7f03af02b5696345589d82b\mscorlib.ni.dll
    Dependencies:
        mscorlib, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089:
            Guid:{D34102CF-2ABF-4004-8B42-2859D8FF27F3}
            Sign:bbf5cfc19bea4e13889e39eb1fb72479a45ad0ec

本地映像中应该只有一个mscorlib,对吗? 我该如何摆脱其他人?


我最近有同样的错误。
这是我修复的方式(希望它也对您有用):

-打开您的项目属性,转到参考部分。

-在上半部分删除对System的引用。

我认为这是两次引用System,但仅显示一次。因此,引用不明确。


根据您的gacutil输出结果(感谢这样做;我认为这会有所帮助),我想说您需要尝试对.NET Framework安装和Visual Studio 2005进行修复。我不确定是否会对其进行修复,但是正如从gacutil的输出中看到的那样,您没有2.0版本。

从VS2005命令提示符中,我得到:

1
2
3
4
5
6
7
Microsoft (R) .NET Global Assembly Cache Utility.  Version 2.0.50727.42
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
  mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86

Number of items = 1

从VS2003命令提示符中,我得到:

1
2
3
4
5
6
7
8
9
10
Microsoft (R) .NET Global Assembly Cache Utility.  Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

The Global Assembly Cache contains the following assemblies:

The cache of ngen files contains the following entries:
    mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d003800460053002d00330037004200430043003300430035000000
    mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=5a00410050002d004e0035002e0031002d0038004600440053002d00330037004200440036004600430034000000

Number of items = 2


重新安装.Net Framework 2.0。

那应该解决它。之后,gacutil(来自v2.0)将显示1 mscorlib而不是0。


昨天,我在VS2005 ASP.NET网站项目中得到了相同的结果:突然,在以前的任何重大代码更改中,名称空间y中出现的x负载都是模棱两可的,它们都源自非常基本的符号,例如EventArgs,类型,DBNull等

直接的原因是双重引用mscorlib,正如我在VS的"类视图"中看到的那样。我相信,真正的原因是自动Windows Update迫使我在几分钟前重新启动计算机。

尝试诸如建立一个全新的ASP.NET网站项目之类的特技,将源文本复制粘贴(在同一台计算机上-无济于事),或者在具有相同VS2005安装的第二台计算机上移动该项目(这有帮助) ,项目正常运行)我几乎可以确定我的代码没有问题,但是我的VS / .NET配置没有问题。而且,我非常不知道如何解决它,因为除了这一问题,互联网上没有任何痕迹描述类似的问题。


我知道这听起来很奇怪,但是您使用"构建"还是"重建"来构建解决方案?如果我遇到类似的有趣问题,则对解决方案进行"全部重建"会有所帮助。


采取一个错误(如ArrayList),然后用完全限定的名称替换类型(我不确定,但是我猜这里:System.Collection.ArrayList)。如果错误消失了,那么您确实存在解决冲突。如果没有,那就另当别论了。
如果所有解决方案都因这些错误而"完善",建议您清理项目。删除所有已编译的内容(dll,pdb等),以及阴影缓存的内容。也许是因为使用旧版本的东西而进行编译。


我也受到了打击,特别是System.Data.SqlClient。尝试取消选中项目管理器中的名称空间,然后手动将它们包括在.vb文件中,就像使用C#一样:

导入System.Data.SqlClient


当寻求诊断编译问题的帮助时,通常有助于发布令人讨厌的源代码:)

这些错误实际上意味着指定的名称与另一个名称冲突,并且编译器无法解决此问题。看起来确实有点奇怪。


推荐阅读