none
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    Question

  • Hi,

    I am getting a problem when debugging an application to my pocketpc device on VS2005, every time there is a call to get a recource below:

    base.Image = (Bitmap)global::MyApp.Properties.Resources.ResourceManager.GetObject("imageName");

     

     I get the following error(s) in output..

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

     

    I have read a post which was about a similar problem but it wasnt helpful would anyone know what could be causing this to happen?

     

    Tuesday, February 07, 2006 10:37 AM

Answers

All replies

  • Hi Carl,

    Can you try the following on your machine:

    Go to '\WINNT\system32\com' and check if "comadmin.dll" is present there. If not copy the dll from another system. Try debugging again.

     

    • Proposed as answer by Abeikufrench Friday, May 11, 2012 5:54 PM
    Tuesday, February 14, 2006 5:42 AM
  • you're passing it the string literal "imageName" instead of what I assume is your variable name, imageName -- no quotes. avoid the hack and slash solution the guy above provides.
    Tuesday, February 14, 2006 1:36 PM
  •  

    thanks for the reply, but the comadmin.dll does already exist in the C:\WINDOWS\SYSTEM32\COM folder (im running XP pro sp2) and i am still getting the same problem. Is there anything else you can suggest?

     

    Thanks,

    Carl.

    Tuesday, February 14, 2006 2:31 PM
  •  

    Hi Andrew,

    Im passing the variable name, how can you pass in a string without quotes?, actually the image(s) loads fine but the exceptions still occur so you can imagine having an CF app with hundreds of images and hundreds of exceptions (ignoring them) occuring making load time extremely slow..

     

    Carl.

    Tuesday, February 14, 2006 2:38 PM
  • Please repost this solution, the link is not working!
    Tuesday, March 20, 2012 2:09 AM
  • For those who come across this page, take a look at the following StackOverflow post:

    http://stackoverflow.com/questions/4516973/first-chance-exception-happened-in-the-construct-of-xmlserializer

    In summary this exception is expected because the system is looking for the XML Documentation files related to the dlls.

    Thursday, January 24, 2013 10:07 PM
  • Wednesday, July 23, 2014 4:29 PM