Error CS0433

M

Mark Rae

Hi,

I have an ASP.NET 2 web application (not web site) project and am using a
web deployment project to deploy to the testing, then the production server.
All has been working well for months now, but today after a recompilation,
the app is throwing the error below when accessing a certain page, although
there are no errors in the compilation process.

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 'iss_proposal' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL'
and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601\intranet_deploy.DLL'

Source Error:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.dwpdglvi
..0.cs Line: 110

Show Detailed Compiler Output:

c:\windows\system32\inetsrv>"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe"
/t:library /utf8output
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NETFiles\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_default.master.28963a75.kbekoadw.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\a891d961\be9bd039_7ed9c601\FreeTextBox.DLL"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_note.ascx.cdcab7d2.0336jmcb.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll"
/R:"C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll"
/R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601
\intranet_deploy.DLL"
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.dwpdglvi
..dll" /debug-
/optimize+/win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\intranet\982f569e\da8b6663\7iemp9ws.res" /w:4
/nowarn:1659;1699
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.dwpdglvi
..0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.dwpdglvi
..1.cs"

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.dwpdglvi
..0.cs(110,46): error CS0433: The type 'iss_proposal' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL'
and
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601\intranet_deploy.DLL'
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL:
(Location of symbol related to previous error)
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601\intranet_deploy.DLL:
(Location of symbol related to previous error)

Error in: /intranet/iss/proposal.aspx
Url: /intranet/iss/proposal.aspx

Error Message: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.gyaz0bv3
..0.cs(110): error CS0433: The type 'iss_proposal' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL'
and
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NETFiles\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601\intranet_deploy.DLL'
Error Source: System.Web
Error Target Site: System.CodeDom.Compiler.CompilerResults Compile() Error
Description: System.Web.HttpCompileException:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\App_Web_proposal.aspx.f71204e2.gyaz0bv3
..0.cs(110): error CS0433: The type 'iss_proposal' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\37c9bf8f\a2199b8c_7af3c601\intranet.DLL'
and
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\intranet\982f569e\da8b6663\assembly\dl3\e4bee18e\a092dc96_7af3c601\intranet_deploy.DLL'
at System.Web.Compilation.AssemblyBuilder.Compile()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContextcontext,
String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)



A quick Google search revealed quite a few possibilities for fixing this,
such as clearing out the temporary files folder, running iisreset, rebooting
the development machine, rebooting the server, adding batch="false" to
web.config, etc.

I tried all of the above and more, but to no avail.

Has anyone else had any experience of this and, if so, is there a solution?

Any assistance gratefully received.

Mark
 
J

Juan T. Llibre

Mark,

Have you checked that you don't actually have 'iss_proposal'
defined in more han one place in your code ?

That would be a reason for the attempt to compile it into two different DLLs:
intranet.DLL and intranet_deploy.DLL.
 
M

Mark Rae

Have you checked that you don't actually have 'iss_proposal'
defined in more han one place in your code ?

That was the first thing I checked. :)

iis_proposal was merely an example - there have been many other similar
errors all with different classes...
That would be a reason for the attempt to compile it into two different
DLLs:
intranet.DLL and intranet_deploy.DLL.

I fully agree, but that's not actually the case....
 
J

Juan T. Llibre

Additional suggestions :

1.
Could you possibly have two code-behind files with the same name ?
( in different directories, of course... )

2.
Is the server under heavy memory load ?
Maybe testing the app with very little load on the server could make a difference.

Check the commit charge on your server and makew sure the server's ram isn't cramped.

3.
Since you're using the web deployment project, review the MSbuild directives.

i.e., change the number of DLL's the application compiles to.
Maybe, even, reduce it to 1 DLL instead of the, at least, two you have now.

(YourAppDeployment Property Pages, Output Assemblies; Merge all output to a single assembly)

4.
Explore one of the other compilation options
 
M

Mark Rae

1.
Could you possibly have two code-behind files with the same name ?
( in different directories, of course... )
No.

2.
Is the server under heavy memory load ?
No.

Check the commit charge on your server and makew sure the server's ram
isn't cramped.

It's just a test server - nothing else is even installed on it...

3.
Since you're using the web deployment project, review the MSbuild
directives.

i.e., change the number of DLL's the application compiles to.
Maybe, even, reduce it to 1 DLL instead of the, at least, two you have
now.

(YourAppDeployment Property Pages, Output Assemblies; Merge all output to
a single assembly)

Tried that...
4.
Explore one of the other compilation options

Tried them too...
 
J

Juan T. Llibre

re:
It's just a test server - nothing else is even installed on it...

If it's "just a test server"...why don't you nuke it ?

Save all your data...and reinstall everything.
That sounds more painful than what it actually is.

:)
 
M

Mark Rae

This *really* is a bug in WAP / WDP...

And you're not going to believe what it is... :)

As we all know, one of the changes in the initial release of ASP.NET 2 was
the deprecation of the CodeBehind Page attribute in favour of the CodeFile
Page attribute:
http://msdn2.microsoft.com/en-us/library/wa20t577.aspx

Fair enough. I'm sure lots of us built brand new ASP.NET 2 websites and
created brand new pages from the Project menu and noticed that the aspx page
had the CodeFile attibute instead of the CodeBehind attribute. Whatever...

However, the ASP.NET development community (hello everyone!) threw its arms
up in horror and said "No, we don't like the new project / site model - we
liked the old project / solution model from v1.1 much better, and we'd like
it back please."

So Microsoft, in a rare moment of actually listening to the development
community, said "OK - here you go - Web Application Projects. And we've even
done Web Deployment Projects for you as well, you lucky people!"

So everyone downloaded and installed the new add-ons and smiled a lot for
they were good.

However, if you build a brand new Web Application Project and create a new
form from the Project menu, you'll see that the aspx Page attribute is
CodeBehind again, not CodeFile...

If you then drop a v2 aspx file from a Web Site Project into a Web
Application Project and FORGET to change its page directive from CodeFile
back to CodeBehind...

Seems the new Web Application Project compilation model doesn't support the
CodeFile page attribute properly, and gets its knickers in a right old
twist... Hence, the double class reference...

AAARRRGGGHHH!!!
 
L

Laurent Bugnion

Hi Mark,

Mark said:
And you're not going to believe what it is... :)

<Snipped>

Happy you figured it out. That also explains why I didn't have that
issue, since I systematically remove the CodeBehind / CodeFile
attributes from the page directive in ASP.NET 1.1 and also in the WAP.

Greetings,
Laurent
 
M

Mark Rae

Happy you figured it out. That also explains why I didn't have that issue,
since I systematically remove the CodeBehind / CodeFile attributes from
the page directive in ASP.NET 1.1 and also in the WAP.

You do all your server-side code in-line...?

Wow!
 
R

Rod

I encountered this exact problem today. After reviewing this post, I
changed my CodeFile attributes to CodeBehind, and thereafter my
application worked without trouble.

Thanks,
Rod Early
www.harristeeter.com
 
M

Mark Rae

I encountered this exact problem today. After reviewing this post, I
changed my CodeFile attributes to CodeBehind, and thereafter my
application worked without trouble.

Yep - as "gotchas" go, this really is a good'un...

I think Scott Guthrie is fed up receiving emails from me (!), so maybe
someone else (maybe one of the MVPs?) might like to contact him about this
so that he can put something on the WAP / WDP site...?
 
L

Laurent Bugnion

Hi,

Mark said:
You do all your server-side code in-line...?

Wow!

No, no. I use this:

<%@ Page language="c#" AutoEventWireup="false"
Inherits="GalaSoftLb.Web.CustomControls.Test.App.TreeviewPage" %>

The "CodeBehind" attribute is only needed by the designer. If you don't
use the designer, you can remove the CodeBehind attribute and use the
Inherits attribute only.

The "CodeFile" attribute is only needed if you don't precompile the
code, i.e. if you publish the CS files. If you precompile, same as
before, you only need the Inherits attribute.

HTH,
Laurent
 
L

Laurent Bugnion

Hi,

Mark said:
Yes - that's what I thought you were referring to - apologies...

If you meant that I do my HTML coding by hand, yes it's the case. The
designer in VS2003 was so terrible anyway, and I code HTML since 1997 or
so, I am just used to it. Besides, the HTML editor is great in VS2005,
it's very fast to just type the HTML.

Funnily enough, this comes handy when I code XAML too ;-)

HTH,
Laurent
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top