The type '_Default' conflicts with the imported type '_Default'

W

Wayne Brantley

I get a warning when I build my web app in VS2005 RTM. This error occurs
for every page that is called default.aspx. (I have one in each folder of
my web application).

Pulling up the files it references, shows both files are code generated and
appear to be identical. At the top of each file is
#pragma checksum [originalfilethisisfor.aspx] and they both refer to the
same file.

How do I get rid of this warning?

Warning 1 The type '_Default' in
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\site\3f4ac539\1f8cc57b\App_Web_k46k7dwr.2.cs' conflicts with the
imported type '_Default' in
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\miniter\3f4ac539\1f8cc57b\App_Web_0ilzep2v.dll'. Using the one in
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\site\3f4ac539\1f8cc57b\App_Web_k46k7dwr.2.cs'.
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\site\3f4ac539\1f8cc57b\App_Web_k46k7dwr.2.cs 128
 
T

tdavisjr

Wayne,

I think something went wrong here. Are you converting a project from
asp.net 1.1 to 2.0 using VS 2005?

I just created the same senario and by default VS will pre-pend the
containing folder names before the page class name when it is declaring
the codebeside file.

E.g

FileName CodeBeside Classname
-----------------------------------------------------------------------------------------

default.aspx --> parital class _default

/subfolder1/default.aspx --> partial class subfolder1_default

/subfolder1/sub1/default.aspx --> partial class
subfolder1_sub1_default

/subfolder2/default.aspx --> partial class subfolder2_default


So, this is the trend you will see going. However, if you are
converting a old project then I don't know if the conversion tool will
take care of this for you.

I hope this helps.
 
E

Edwin Knoppert

I had the same, while default.aspx wasn't in the same folder (obviously :) )
VWD complaints about the (class)names.
 
W

Wayne Brantley

Found it. My master page was called defaut.master - the code behind was
named default! So, I just renamed my codebehind class. That will do it!
 

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

Top