Wednesday, March 28, 2012

Sytem.Drawing.ToolboxBitmapAttribute

I have a simple page that uses the UpdatePanel and runs fine locally, but when uploaded to a Windows 2003 server with .NET 2.0 and AJAX Extensions 1.0 installed I get the following error:

"The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception."

As far as I understand it, that part of the framework is for Windows Forms. This is an ASP.NET website. Any ideas?

Ashiki:

"The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception."

As far as I understand it, that part of the framework is for Windows Forms. This is an ASP.NET website. Any ideas?

The ToolboxBitmapAttribute is used for all ServerControls with an UI to show an icon in the VS ToolBox. Maybe it helps to register the System.Web.Extensions.Design.dll in the web.config on youre Server because the UpdatePanel has a reverence in his Attributes to the resources in this assembly. Reflector shows the classdeffinition as follows.

[

Designer("System.Web.UI.Design.UpdatePanelDesigner, System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),ToolboxBitmap(typeof(EmbeddedResourceFinder),"System.Web.Resources.UpdatePanel.bmp"),DefaultProperty("Triggers"),ParseChildren(true),PersistChildren(false),AspNetHostingPermission(SecurityAction.LinkDemand,Level=AspNetHostingPermissionLevel.Minimal),AspNetHostingPermission(SecurityAction.InheritanceDemand,Level=AspNetHostingPermissionLevel.Minimal)]

Hope that helps


I see - the web.config automatically generated by VS for an AJAX site has this already in the web.config:

<

assemblies>

<

addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

assemblies>

I'd never noticed that before, and I guess its there for the reason you give. I've tried adding a reference for System.Web.Extensions.Design as well, just in case, but I still get the same error on the server.


In youre first posting you write: "Thetype initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception"!

If it possible, debug the App on the Server to see where exactly the Exception is thrown.

I think the Exception is thrown on this point:ToolboxBitmap(typeof(EmbeddedResourceFinder),

If so, you see more Information in the stack.

Hope that helps.


I can run the website from VS installed on the server and there are no errors at all - it runs fine. When I access the site externally from a browser though I still get the error. Is it a permissions thing?

Well, after many trial and error attempts at a fix I finally uninstalled AJAX Extensions, installed SP2 for Windows 2003, deleted the website from IIS, re-installed AJAX, recreated the website and now its all running OK.


Hello, I have the same error since 2 days on my server. I have a dropdown list .

http://www.laposturologie.com/testbug.aspx

Pleaaaaaase help


I never found out what that error message means, but once I had done the uninstall and re-install as in my post above I've never seen the error again.


godaddy don't want to help me about that error

they told me it is in my code...there's nothing wrong in my code because i have changed nothing and then this error came up.

u can see the page :

http://www.carteinter.com/testbug.aspx

this error happens only when there is a gridview and an sql datasource

u can see the working page

http://www.carteinter.com/testbug.aspx


mistake in last post

the working page is

http://www.carteinter.com/Main.aspx

the page not working is

http://www.carteinter.com/testbug.aspx


I'm having this problem as well. It's only on the host and it happens with both a GridView and a DataList. I'm using an ObjectDataSource instead of a SQLDataSource, but it seems like it's the GridView (not the data source) that's causing the grief. I've removed everything else that could be causing this problem. I just have a class with a static method that gets some rows from the DB and puts them in a DataSet. I've set this as the SelectMethod for my ObjectDataSource and bound the GridView to the ObjectDataSource.

I get the parser error with this simple page (2 controls, nothing else).

Unfortunately, like others have mentioned - since I am on a host (GoDaddy) I can't just reinstall, reboot, delete temporary IIS files, or reset IIS. I did change things several times so the app got recycled, but I've continued to have problems.

Its pretty clear something to do with the server control is not functioning properly and it would be nice to get a little help from someone at Microsoft. Those of us on external hosts are pretty much stuck here. I can rewrite the code to display all this by hand (using codebehind) but that will take a lot of work.


CHANGE HOST ASAP!!!!!!!!!!!

GODADDY REALLY SUCKS !!

THEY CAN'T FIX A BUG, THERE ARE POOR IN TECHNICAL SUPPORT, THERE ARE SURELY A LOT OF USERS THAT HAVING THIS PROBLEM

IM NOT THE ONLY ONE AS U CAN SEE...

I HAVE CHANGED HOST AND NOW MY WEB SITE WORKS FINE

U CAN TAKE A LOOK :

WWW.CARTEINTER.COM

No comments:

Post a Comment