ascx is ambiguous in the namespace ASP

J

Jerry C

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
 
T

Teemu Keiski

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
:)
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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.


--------------------
 
J

Jerry C

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
--
Jerry


Steven Cheng said:
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:
(e-mail address removed).

==================================================
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.


--------------------
 
J

Jerry C

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,
 
J

Jerry C

sorry forgot to put in the page;

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

Thank you
--
Jerry


Steven Cheng said:
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:
(e-mail address removed).

==================================================
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.


--------------------
 
J

Jerry C

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,
--
Jerry


Steven Cheng said:
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:
(e-mail address removed).

==================================================
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.


--------------------
 
L

Lloyd Sheen

Jerry C said:
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,
--
Jerry


Steven Cheng said:
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:
(e-mail address removed).

==================================================
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.

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
 
J

Jerry C

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.
 
L

Lloyd Sheen

Jerry C said:
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.

thanks I will check that out.

LS
 
T

Teemu Keiski

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.
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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==?= <[email protected]>
References: <[email protected]>
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
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,
 
J

Jerry C

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
 
S

Steven Cheng [MSFT]

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:
(e-mail address removed).

==================================================
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.

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top