473,498 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DllNotFoundException

Hello,
I have an asp.net script that references system.drawing and I am receiving
the following the error when using system.drawing.bitmap:

Exception Details: System.DllNotFoundException: Unable to load DLL
(gdiplus.dll).
[DllNotFoundException: Unable to load DLL (gdiplus.dll).]
System.Drawing.SafeNativeMethods.GdiplusStartup(In tPtr& token,
StartupInput& input, StartupOutput& output) +0
System.Drawing.SafeNativeMethods.Initialize() +117
System.Drawing.SafeNativeMethods..cctor() +155

[TypeInitializationException: The type initializer for
"System.Drawing.SafeNativeMethods" threw an exception.]
System.Drawing.SafeNativeMethods.GdipCreateBitmapF romScan0(Int32 width,
Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
+0
System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat
format) +76
ASP.graphics_aspx.__Render__control1(HtmlTextWrite r __output, Control
parameterContainer) in file.aspx:9
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +27
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Page.ProcessRequestMain() +1929

On the same system I have a C# application that uses system.drawing and it
works with no problem. I've tried reinstalling the framework with no avail.

Any suggestions on how to fix this?

Thanks,
Aaron Stubbendieck
Nov 18 '05 #1
4 3759
Hi,
Strange. GDI+ is part of XP 2003, OS. From MSDN :
"GDI+ is the portion of the Windows XP operating system or Windows
Server 2003 operating system that provides two-dimensional vector
graphics, imaging, and typography. GDI+ improves on Windows Graphics
Device Interface (GDI) (the graphics device interface included with
earlier versions of Windows) by adding new features and by optimizing
existing features. " it's not .Net or COM object just native windows
DLL.

Usually when something working with win app and not with web apps it’s
all about security reasons. try to use <Identity impersonate="true" User
name="" Password=""> where user name will be set with your user, just
for testing - it's security hole.

Take a look also at:
http://msdn.microsoft.com/library/de.../en-us/gdicpp/
gdiplus/gdiplus.asp
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
I tried using impersonate with the local admin account (on the server) with
and the script executed perfectly. When I turned impersonation back off,
the script stopped working, so it must be a permissions problem. The
inetpub directoy has Read & Execute, List, and Read permissions for the
asp.net account. The actual gdiplus.dll in
%systemroot%\WinSxS\x86_Microsoft.Windows.GdiPlus_ 6595b64144ccf1df_1.0.0.0_x
-ww_8d353f13 and
%systemroot%\WinSxS\x86_Microsoft.Windows.GdiPlus_ 6595b64144ccf1df_1.0.10.0_
x-ww_712befd8 only have permissions for Administrators and System, I tried
giving the IIS guest accouts privileges with no success.

I've also tried running aspnet_regiis.exe -i, with nothing different
happening.

Any suggestions on what to try next?

Thanks,
Aaron Stubbendieck
Nov 18 '05 #3
Aaron Hi,

The default asp.net user doesn’t have permissions to activate COM
objects. Setting permissions of directories won’t help you. You need to
create user with minimal permissions but with the ability to activate
COM objects. You might use the following link to find out what rights
that user should have :
msdn.microsoft.com/library/en-us/dnnetsec/html/ThreatCounter.asp

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
Thanks for pointing me in the right direction. I used the guide from:
http://msdn.microsoft.com/library/de...SecNetHT01.asp

And it works perfectly.

Thanks,
Aaron Stubbendieck
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
297
by: DC | last post by:
Hi, I have created a ASP .net client talking to a .net web service. The web service in turn calls a C++ dll to get data from the host. The whole thing is working perfectly fine on my machine,...
1
2330
by: nagarajan.palanisamy | last post by:
Hello, We developed a DLL using C++ and I am calling the methods on the DLL using p/Invoke from managed code. The application runs well both as a console application and as a Windows Service...
1
15478
by: Anna | last post by:
When I run a c#DotNet web service, I have the following error: System.DllNotFoundException: Unable to load DLL The dll that cannot be loaded is a C dll. That's why it cannot be put in the GAC....
1
2542
by: batista | last post by:
Hi, I have an unmanaged dll that uses callback to call a function of managed code.Now the problem is that it's given error "System.DllNotFoundException" I read it's due to appdomian....
1
1766
by: Petr Makagon | last post by:
i have a c++ managed wrapper around unmanaged dll. when i use this wrapper from managed console app it works fine but when i use it in aspx i have DllNotFoundException occurred in Unknown...
1
2523
by: Jorge_Beteta | last post by:
Hello Experts, I'm using Visual Studio NET 2003 Architect on a Windows 2003 Server. DataBase: Oracle 9i. All of them on the same PC. Problem is that I can't connect my ASP NET web program to...
0
1278
by: AG | last post by:
Hi, I have implemented the ASP.Net Ihttphandler interface. Handler references the mixed dll (both managed/unmanaged code) that contains core C++ classes wrapped under managed c++ wrappers....
22
3236
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
1
2235
by: Zhihong Yu | last post by:
Hi, I declare an API as following: Public Declare Function IsFirstInstance Lib "WPLink.dll" () As Integer When I call this function in Main(), I got System.DllNotFoundException even though...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.