none
The type initializer for 'Gdip' threw an exception. RRS feed

  • Question

  • Yet again a problem with GDI+

     

    I get "The type initializer for 'Gdip' threw an exception." if my site is accessed from the Internet.

    The error pops up on

     

    Dim my_image as New Bitmap(...)

    or

    Dim my_image as New Image(...)

    No matter what I use for creating them: filestream, memory stream, or EVEN IF I create an empty object!!

    If I run my site under VS 2010 everything works just fine.
    I reinstalled VS, it did not help.

    On some forums users say that it deals with access rights to directories, but my IIS_UISRS and IUSR have full read and write rights for the directory of my project and a directory where I store png-files.

    What else should I check in MS Vista?


    • Edited by Yamadera Friday, December 2, 2011 2:03 PM
    • Moved by Paul Zhou Monday, December 5, 2011 1:52 AM off-topic (From:Common Language Runtime)
    Friday, December 2, 2011 12:46 PM

All replies

  • I had an asp.net problem where (unbeknownst by me) the temp directory could not be accessed due to privlidges

    (Web Service Unable to access Directory (Temporary ASP.NET Files) CS0016)

    Even though this may not be your issue, how I resolved the above issue may help you discover what is going on. I used Filemon at the time which is now Process Monitor v2.96 to look at what the system was reporting as it attempted to open files. I recommend you do the same on the machine which is giving you this issue. If nothing else you may be able to rule out file or directory permissions; or find the temp directory which your process doesn't have acces to. :-)

    HTH


    William Wegerson (www.OmegaCoder.Com)
    Friday, December 2, 2011 2:13 PM
  • I had an asp.net problem where (unbeknownst by me) the temp directory could not be accessed due to privlidges

    (Web Service Unable to access Directory (Temporary ASP.NET Files) CS0016)

    Even though this may not be your issue, how I resolved the above issue may help you discover what is going on. I used Filemon at the time which is now Process Monitor v2.96 to look at what the system was reporting as it attempted to open files. I recommend you do the same on the machine which is giving you this issue. If nothing else you may be able to rule out file or directory permissions; or find the temp directory which your process doesn't have access to. :-)

    HTH


    William Wegerson (www.OmegaCoder.Com)
    • Edited by OmegaMan Friday, December 2, 2011 2:15 PM
    Friday, December 2, 2011 2:13 PM
  • I played with the program you recommended, OmegaMan.

    When the site is access from the Internet I see this line on the log:

     

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\a02cffaa\196f9067\App_Web_pcrs4c2n.dll

    Sharing violation

     

    IIS_IUSRS has full read and write rights. But nothing has changed. I added another user, IUSR and gave it some rights. "Sharing violation" stopped showing up, but It did not solve my problem.

     

    I think that the best wayround for now is an alternative graphic library. Any ideas about it? I just want some basic functions from this library:

    1) open a graphic file

    2) write a text on it

    3) add image on top of another image

    4) converting the image into byte array or a memory stream

     

    Does anybody know free graphical libraries to do mentioned operations that work with .NET?

    Saturday, December 3, 2011 3:25 AM
  • Ask this question with the new information in the Asp.Net forums instead.  I think you might get a more knowledgable response on how to fix this current issue than the people who frequent the CLR forum. HTH
    William Wegerson (www.OmegaCoder.Com)
    Sunday, December 4, 2011 3:03 PM
  • Hi,

     

    Welcome to the MSDN forum.

     

    According to your description, I'd like to move your thread to off-topic because it is a problem related to ASP.NET GDI+. You may post thread in System.Drawing/GDI+. There are more experts in that forum so that you may get more useful help there.

     

    Thank you for your posting and understanding.

    Have a nice day.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Monday, December 5, 2011 1:51 AM