Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2009, 10:28 AM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default compilation error

Hi Here I get compilation error when i run asp.net 2.0 application on Widnows server 2000. Could please give me some insight into this problem. I tried to add system.drawing from the visualstudio 2005, but no use.

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: CS0012: The type 'System.Drawing.Color' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Source Error:


Line 18: <td colspan="2" style="border-bottom: olive thick solid; height: 1px; background-color: #003399">
Line 19: <img align="absmiddle" src="Images/logo.gif" style="border-left-color: olive; border-left-style: none; border-right-width: thick; border-right-color: olive; width: 87px; height: 97px;" />
Line 20: <asp:SiteMapPath ID="SiteMapPath1" runat="server" ForeColor="FloralWhite" style="vertical-align: top">
Line 21: <NodeStyle BackColor="#80FFFF" />
Line 22: <CurrentNodeStyle ForeColor="Blue" />
 
Old February 6th, 2009, 12:04 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

I would try this:

Code:
<asp:SiteMapPath ID="SiteMapPath1" runat="server" style="vertical-align: top; color: #fffaf0;">
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old February 10th, 2009, 01:26 PM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Lee Dumond View Post
I would try this:

Code:
<asp:SiteMapPath ID="SiteMapPath1" runat="server" style="vertical-align: top; color: #fffaf0;">
Tried but no use...Its frustrating me this error even i dont find any references online regarding this specific error
 
Old February 10th, 2009, 03:19 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Did you use the code EXACTLY as Lee posted it? It seems to me that .NET does not like the color you have supplied for the ForeColor attribute of your SiteMap.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 
Old February 10th, 2009, 05:12 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

The problem is simple: The color "FloralWhite" is defined (I'm pretty sure in an enumeration) in (as the error message says) System.Drawing.Color.

Now, why that DLL is not included in his build and not loaded to the production server, I dunno. But either using a <STYLE> as Lee suggested *OR* (I believe) using a number instead of a name should get rid of the dependency on the DLL.

And while Lee's suggestion of using a <STYLE> should get him past that one line 20, he will then run into the line
Code:
Line 22:                         <CurrentNodeStyle ForeColor="Blue" />
and there's no good way to use a <STYLE> for that. (This might be what he meant when he said he'd tried Lee's suggestion and it didn't work. He is being very reticent in supplying us with details.) So I'd suggest just using color numbers. Perhaps
Code:
<CurrentNodeStyle ForeColor="#0000FF" />
I'm not sure that will do the job. Possibly the compiler will still assume it needs that DLL just because of the ForeColor= reference. But it's worth a stab.
 
Old February 12th, 2009, 12:23 PM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Old Pedant View Post
The problem is simple: The color "FloralWhite" is defined (I'm pretty sure in an enumeration) in (as the error message says) System.Drawing.Color.

Now, why that DLL is not included in his build and not loaded to the production server, I dunno. But either using a <STYLE> as Lee suggested *OR* (I believe) using a number instead of a name should get rid of the dependency on the DLL.

And while Lee's suggestion of using a <STYLE> should get him past that one line 20, he will then run into the line
Code:
Line 22:                         <CurrentNodeStyle ForeColor="Blue" />
and there's no good way to use a <STYLE> for that. (This might be what he meant when he said he'd tried Lee's suggestion and it didn't work. He is being very reticent in supplying us with details.) So I'd suggest just using color numbers. Perhaps
Code:
<CurrentNodeStyle ForeColor="#0000FF" />
I'm not sure that will do the job. Possibly the compiler will still assume it needs that DLL just because of the ForeColor= reference. But it's worth a stab.
OK let me try this way and i will put back if any errors, but this time i will give you a complete picture..
 
Old February 12th, 2009, 02:14 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Umm... just an idea...

The error message says that you haven't referenced the System.Drawing assembly. So, why not just ADD the reference?

In web.config:

Code:
<compilation>
   <assemblies>        
      <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
   </assembies>
</compilation>
If that doesn't work, you have a bigger issue that you would just be covering up by using the RGB codes. It means the System.Drawing assembly is missing from your server, and that's not good.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}

Last edited by Lee Dumond; February 12th, 2009 at 03:33 PM.. Reason: add more info
 
Old February 12th, 2009, 06:01 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Well, in his first post he said
Quote:
I tried to add system.drawing from the visualstudio 2005, but no use.
so I (perhaps foolishly) assumed he had already done that. I guess we'll find out.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Microsoft VBScript compilation error '800a0409' webXtreme Classic ASP Basics 4 February 4th, 2009 03:58 AM
Compilation Error darkestangel1980 ASP.NET 2.0 Basics 0 February 4th, 2008 05:46 AM
compilation error luizou Classic ASP Components 1 February 10th, 2005 06:25 PM
compilation error msrnivas .NET Web Services 3 June 9th, 2004 07:19 AM
compilation error saint Classic ASP Databases 2 June 23rd, 2003 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.