473,566 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DllNotFoundExce ption

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.DllNotFo undException: Unable to load DLL
(gdiplus.dll).
[DllNotFoundExce ption: Unable to load DLL (gdiplus.dll).]
System.Drawing. SafeNativeMetho ds.GdiplusStart up(IntPtr& token,
StartupInput& input, StartupOutput& output) +0
System.Drawing. SafeNativeMetho ds.Initialize() +117
System.Drawing. SafeNativeMetho ds..cctor() +155

[TypeInitializat ionException: The type initializer for
"System.Drawing .SafeNativeMeth ods" threw an exception.]
System.Drawing. SafeNativeMetho ds.GdipCreateBi tmapFromScan0(I nt32 width,
Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
+0
System.Drawing. Bitmap..ctor(In t32 width, Int32 height, PixelFormat
format) +76
ASP.graphics_as px.__Render__co ntrol1(HtmlText Writer __output, Control
parameterContai ner) in file.aspx:9
System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer writer) +27
System.Web.UI.C ontrol.Render(H tmlTextWriter writer) +7
System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer) +243
System.Web.UI.P age.ProcessRequ estMain() +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 3770
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="tr ue" 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%\Wi nSxS\x86_Micros oft.Windows.Gdi Plus_6595b64144 ccf1df_1.0.0.0_ x
-ww_8d353f13 and
%systemroot%\Wi nSxS\x86_Micros oft.Windows.Gdi Plus_6595b64144 ccf1df_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.e xe -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.a sp

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, but when I am deploying the components on a Window 2000 server, running the application is throwing this error: System.DllNotFoundException:...
1
2339
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 application on Windows 2000 machine. But on windows 2003 server (Standard Edition), only console application runs but not the windows service...
1
15496
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. This dll is located in c:\Program Files\MyApplication\bin The environment variable "PATH" contains "c:\Program Files\MyApplication\bin" Where...
1
2554
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. http://weblogs.asp.net/mdavey/archive/2004/02/25/79868.aspx
1
1774
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 Module. any idea???!!!
1
2531
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 Oracle. I get this error: "System.DllNotFoundException: ?" after trying to do: Dim myConn As OracleConnection = New OracleConnection("data...
0
1285
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. ASP.NET worker process, sometimes while loading the handler and mixed dll associated with it, throws System::DLLNotFoundException. I have verified that...
22
3251
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 load DLL (aspnet_isapi.dll)." Of course the dll is able to be found, it's still in the framework directory and for grins I even put it in my...
1
2252
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 WPLink.dll is copied alongside .Net program or under <system32>. Your help is appreciated. *** Sent via Developersdex http://www.developersdex.com ***
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.