System.Drawing.SafeNativeMethods threw an exception 
Author Message
 System.Drawing.SafeNativeMethods threw an exception

If I create a simple C#.NET project,
I can run it from cmdline and it works fine, run it from
a web and system.draw bombs out trying to get image
height and width. For testing, I did one with just
system.io to get basic file information, and it works
fine.  I have set IIS to interact with the desktop and
gave aspnet account admin right for grins and still
nothing. This is my error:

Unhandled Exception: System.TypeInitializationException:
The type initializer
for "System.Drawing.SafeNativeMethods" threw an
exception. --->
System.Runtime.InteropServices.ExternalException: Failed
to create system events window thread.
   at Microsoft.Win32.SystemEvents.EnsureSystemEvents
(Boolean requireHandle, Boolean throwOnRefusal)
   at Microsoft.Win32.SystemEvents.InvokeOnEventsThread
(Delegate method)
   at System.Drawing.SafeNativeMethods.Initialize()
   at System.Drawing.SafeNativeMethods..cctor()
   --- End of inner exception stack trace ---
   at
System.Drawing.SafeNativeMethods.GdipCreateBitmapFromFile
(String filename, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(String filename)
   at ABCImages.ScaleImages.Main(String[] args)



Wed, 15 Jun 2005 09:43:10 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. System.Drawing.SafeNativeMethods.GdipCreateFontFromLogfont fails

2. System.Drawing.Bitmap.FromResource throwing System.ArgumentException

3. Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System

4. System.Timers.Timer can't throw Exception?

5. System.ExecutionEngineException exception

6. System.Drawing.Design.UITypeEditor

7. Using efficiently System.drawing.design.imageEditor class

8. System.Drawing.Graphics.Clear(Color color) gives me a Compile Error

9. Exception handling - how to know which exceptions are thrown

10. DS==SS vs DS!=SS in a DLL

11. Throw an exception or use System.Diagnostics.Debug.Assert()?

12. ? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_

 

 
Powered by phpBB® Forum Software