publish web website got compilor error CS0433 for master page

N

ningjun.wang

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\Temporary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\56c26b89\5255fd02_8e1fc701\App_Web_448itj0s.DLL'
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\news\408804a4\6fb240fa\assembly\dl3\0e565373\78306203_8e1fc701\App_Web_hkd2czr6.DLL'

Source Error:

Line 110:
Line 111:
[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
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\Temporary
ASP.NET
Files\news\408804a4\6fb240fa\App_Web_masterpage.master.cdcab7d2.nxp-zado.0.cs
Line: 112

Please advise
 
M

Mark Fitzpatrick

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.
 

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