By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

publish web website got compilor error CS0433 for master page

P: n/a
I crate a new asp.net 2.0 web site using Visual Studio 2005. It run
fine in visual studio. I then click Build Publish Website to build
the dll and copy them to the IIS virtual directory along with all the
..aspx files. I run the application in IIS and got the following error:

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'MasterPage' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\56c26b89 \5255fd02_8e1fc701\App_Web_448itj0s.DLL'
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\0e565373 \78306203_8e1fc701\App_Web_hkd2czr6.DLL'

Source Error:

Line 110:
Line 111:
[System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]
Line 112: public class masterpage_master : global::MasterPage {
Line 113:
Line 114: private System.Web.UI.ITemplate
@__Template_mainContent;
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
ASP.NET
Files\news\408804a4\6fb240fa\App_Web_masterpage.ma ster.cdcab7d2.nxp-zado.0.cs
Line: 112

Please advise

Dec 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You may want to check and verify that you don't have two dlls that have the
definition for this class. That's one of the problems with using the web
site project, it compiles the files in a directory as needed and assigned
them some number to make them unique. Unfortunately, this will leave you
with two different dlls that contain the same exact namespace references,
which is probably what this is telling you about. This means you have to
ensure you delete the old dlls first. You may want to try the new Web
Application Project which is downloadable over at www.asp.net. It
precompiles the site into a single dll in the same fashion that VS 2003 did.
--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

<ni**********@lexisnexis.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
>I crate a new asp.net 2.0 web site using Visual Studio 2005. It run
fine in visual studio. I then click Build Publish Website to build
the dll and copy them to the IIS virtual directory along with all the
.aspx files. I run the application in IIS and got the following error:

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'MasterPage' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\56c26b89 \5255fd02_8e1fc701\App_Web_448itj0s.DLL'
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Tem porary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\0e565373 \78306203_8e1fc701\App_Web_hkd2czr6.DLL'

Source Error:

Line 110:
Line 111:
[System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]
Line 112: public class masterpage_master : global::MasterPage {
Line 113:
Line 114: private System.Web.UI.ITemplate
@__Template_mainContent;
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary
ASP.NET
Files\news\408804a4\6fb240fa\App_Web_masterpage.ma ster.cdcab7d2.nxp-zado.0.cs
Line: 112

Please advise

Dec 14 '06 #2

P: n/a
Thanks for the help. I found the problem. I have backed up my
MasterPage.master as MasterPage_backup.master long time ago. As a
result, both files got compiled and they define exactly the same class.
I used to use Visual C++ 6.0 and it will generate a compilation error
when two source files define the same class. Visual Studio 2005 should
do a better hob to detecdt such error during compilation.

Dec 15 '06 #3

P: n/a
re:
Visual Studio 2005 should do a better hob to detecdt such error during compilation
Or, you could simply rename your backup files with the .bak extension.
That would solve the problem, too.

MasterPage.master.bak won't be compiled.

I often have *two* backup files for different versions.
I rename the older backup *.old. ( MasterPage.master.old , in this case ).

That way, I have references to previous configurations, while avoiding compilation errors.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ni**********@lexisnexis.comwrote in message
news:11*********************@t46g2000cwa.googlegro ups.com...
Thanks for the help. I found the problem. I have backed up my
MasterPage.master as MasterPage_backup.master long time ago. As a
result, both files got compiled and they define exactly the same class.
I used to use Visual C++ 6.0 and it will generate a compilation error
when two source files define the same class. Visual Studio 2005 should
do a better hob to detecdt such error during compilation.

Dec 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.