Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

ascx is ambiguous in the namespace ASP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerry C - 18 Apr 2008 19:11 GMT
I have a machine Windows Server 2003 using IIS 6.0 and I am getting the error

BC30560 prjob_ascx is ambiguous in the namespace ASP

I found a fix. Deleting all the files in the
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
Directory fixes the problem.

Is there a way to prevent this problem.

Thank you
Signature

Jerry

Teemu Keiski - 18 Apr 2008 21:25 GMT
Are you sure you don't have the same ascx twice?. You should be able to
overcome this, by in @Control directive of the UV, giving it
ClassName="name" where name is something different than the name of your uc
:-)

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

>I have a machine Windows Server 2003 using IIS 6.0 and I am getting the
>error
[quoted text clipped - 8 lines]
>
> Thank you
Steven Cheng [MSFT] - 21 Apr 2008 05:05 GMT
Hi Jerry,

This error is usually reporting that there are some pages or usercontrols
that have the same name in the generated assemblies since ASP.NET use a
dynamic compilation model. For example, you may contains a usercontrol and
a web page and they have the same name.

http://forums.codecharge.com/posts.php?post_id=55779

As Teemu suggested, you can try renaming the ascx control mentioned in the
error message to see whether that can eliminate the conflicting.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?SmVycnkgQw==?= <jerryed@nospam.nospam>
>Subject: ascx is ambiguous in the namespace ASP
>Date: Fri, 18 Apr 2008 11:11:02 -0700

>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
[quoted text clipped - 9 lines]
>
>Thank you
Jerry C - 21 Apr 2008 14:23 GMT
Thank you for the replys.

This error occours only once in a while. If I had duplicate files in the
directory it would occur every time the site compiles. Also the file name is
xxx_ascx The underbar is not used anywhere in my code for a name of a control
or class. this seems to be a framework error. Also If there were duplicate
names in my code I would have to remove them to get the code to compile. To
fix this error I have to remove the temp files and then it will compile. So I
do not think this is a error caused by duplicate file names. Also this
problem only occurs on one of my servers. The other server used for coding
and testing work OK. Remember this server can run for weeks before this
occurs. The link talks about problems that ocur every time the code is
compiled this is not the case here. Deleting the temp files clears the error
and the code compiles and runs OK.

Thank you
Signature

Jerry

> Hi Jerry,
>
[quoted text clipped - 58 lines]
> >
> >Thank you
Jerry C - 21 Apr 2008 15:54 GMT
sorry forgot to put in the page;

http://channel9.msdn.com/ShowPost.aspx?PostID=160949

Thank you
Signature

Jerry

> Hi Jerry,
>
[quoted text clipped - 58 lines]
> >
> >Thank you
Jerry C - 21 Apr 2008 18:33 GMT
I tried the suggestion to put in a ClassName= in the <%@ Control  section of
the ascx file. This seemed to work. But when I deployed it then the next ascx
file in the app had the error. so after several rounds of this I just put the
ClassName in every ascx in the app and this worked.

So how is it I can have  about a 100 duplicate ascx and aspx files in the
app and don't know it and not beable to find them. and why is only a problem
in one server of 5 and why has this just now become a problem after three
years ??? The control section and the class name of the code behind is
created by the development environment if it needs the CLassName= then why
does it not put it in. I think there is something else here and I think I
need to know that is is. I don't want this to happen at the customers sites.

Thank you,
Signature

Jerry

> Hi Jerry,
>
[quoted text clipped - 58 lines]
> >
> >Thank you
Lloyd Sheen - 21 Apr 2008 18:37 GMT
>I tried the suggestion to put in a ClassName= in the <%@ Control  section
>of
[quoted text clipped - 84 lines]
>> >
>> >Thank you

I have exactly the same problem.  There are no identical names, nothing even
close.  It only happens when I change an ascx file.  It will happen if I use
F5.  If I then use the Start Debugging arrow on the toolbar it will start
and the next time not do this.  I think it must have something to do with
the temp files.

LS
Jerry C - 21 Apr 2008 18:53 GMT
Lloyd,

See my last post. Put in the ClassName="classname" in the <%@ Control  
section of the ascx file and see if that works. This has been a problem for a
while and now it seems to be getting worse must be some sort of update from
microsoft.

Signature

Jerry

> >I tried the suggestion to put in a ClassName= in the <%@ Control  section
> >of
[quoted text clipped - 92 lines]
>
> LS
Lloyd Sheen - 21 Apr 2008 19:16 GMT
> Lloyd,
>
[quoted text clipped - 119 lines]
>>
>> LS

thanks I will check that out.

LS
Steven Cheng [MSFT] - 22 Apr 2008 05:46 GMT
Hi Jerry,

As Teemu has mentioned, the duplicated name here may also be caused by two
page/user control in differetn folder hierarchy that have the same file
name. ASP.NET use dynamic compilation and will batch compile multiple
page/ascx controls by default. When you haven't explicitly specify a
ClassName( in the directive), if will generate dynamic class depend on file
name. And if runtime try batch compiling two of such controls or pages,
potential naming confliction occurs. The reason why the problem ocassionaly
occurs is that batch compile is not  always using the same strategy to
group page or usercontrol together, for most time, the two problem items
may not be compiled into the same assmebly, then no error will occur.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?SmVycnkgQw==?= <jerryed@nospam.nospam>
>References:  <C696C760-1DE5-4948-92B5-C662831BA1ED@microsoft.com>
<tBGN8T2oIHA.9932@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: ascx is ambiguous in the namespace ASP
>Date: Mon, 21 Apr 2008 10:33:00 -0700

>I tried the suggestion to put in a ClassName= in the <%@ Control  section of
>the ascx file. This seemed to work. But when I deployed it then the next ascx
[quoted text clipped - 37 lines]
>> ==================================================
>> Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
[quoted text clipped - 31 lines]
>> >
>> >Thank you
Jerry C - 21 Apr 2008 15:54 GMT
Here is another post about the temp dir.
These users have the same problem. It is not duplicate files
My understanding of what you mean by duplicate files is a two files
aaabbb.ascx
aaabbb.aspx
I do not have this problem. The files in my app are in alpha order so it
would be easy to see if it existed. There are no other directories in the app
that contain that type of file.

Thank you,
Signature

Jerry

> I have a machine Windows Server 2003 using IIS 6.0 and I am getting the error
>
[quoted text clipped - 7 lines]
>
> Thank you
Teemu Keiski - 21 Apr 2008 21:09 GMT
Duplicate could also mean here that you have same ascx file in multiple
subfolders.

subfolder1\myuc.ascx
subfolder2\myuc.ascx

If ASP.NET thinks for some reason that they might end up in same
assembly(for example pages in same directory, referencing UC's from
different directories --> pages are compiled into same assembly), end result
is that they would be ambiguous. In practise you woukldn't really duplicate
UCs like this, without a good reason...

I've seen this starting in ASP.NET 1.x and using ClassName attribute helps
with no exception as it forces ASP.NET to compile the dynamic UC type with
different name.

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

> Here is another post about the temp dir.
> These users have the same problem. It is not duplicate files
[quoted text clipped - 20 lines]
>>
>> Thank you
Jerry C - 22 Apr 2008 14:09 GMT
TeemU, Steven

Thank you for your replys.

So far the ClassName has worked.

But, I do not have subfolders there are no duplicate names in page/control
files in the application. I can search the directory structure and get only
one hit per file name without the extention. This is some other problem.
There are a lot of posts about this problem and everybody with the problem
can't be mistaken about this. There are some theories about the compiler
renaming the control xxxxx_ascx and also the class xxxxx_ascx and causing
this problem, the ClassName solves this.

Any way the ClassName solved the problem and I will put it in all controls I
create.

Thank you for your help


Signature

Jerry

> Duplicate could also mean here that you have same ascx file in multiple
> subfolders.
[quoted text clipped - 36 lines]
> >>
> >> Thank you
Jerry C - 24 Apr 2008 17:43 GMT
The problem is back:
This time the ambiguous is now xxxxxx without the _ascx.

I found another post:
http://personalinertia.blogspot.com/2007/06/there-bug-in-compiler.html

Notice the word BUG. I hope this works.

Thank you
Signature

Jerry

> I have a machine Windows Server 2003 using IIS 6.0 and I am getting the error
>
[quoted text clipped - 7 lines]
>
> Thank you
Steven Cheng [MSFT] - 29 Apr 2008 04:43 GMT
Hi Jerry,

Is it possible to repro the problem by a simple web project with page and
usercontrol? If so, I would suggest you submit this problem to our connect
site:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

the dev engineer will try repro it if it is a definite problem.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?SmVycnkgQw==?= <jerryed@nospam.nospam>
>References:  <C696C760-1DE5-4948-92B5-C662831BA1ED@microsoft.com>
>Subject: RE: ascx is ambiguous in the namespace ASP
>Date: Thu, 24 Apr 2008 09:43:00 -0700

>The problem is back:
>This time the ambiguous is now xxxxxx without the _ascx.
[quoted text clipped - 17 lines]
>>
>> Thank you

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.