Windows 10: System.IO.FileNotFoundException

Discus and support System.IO.FileNotFoundException in Windows 10 Customization to solve the problem; So, I'm trying to run this aplication that needs to write stuff to the hosts file and it seems like the aplication can't find or access this file... Discussion in 'Windows 10 Customization' started by gintarasbidva, Aug 22, 2019.

  1. System.IO.FileNotFoundException


    So, I'm trying to run this aplication that needs to write stuff to the hosts file and it seems like the aplication can't find or access this file however all of my permissions seem to be set up correctly to access this file.

    Log:

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ** Exception Text **
    System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\system32\drivers\etc\hosts'.
    File name: 'C:\WINDOWS\system32\drivers\etc\hosts'
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
    at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
    at System.IO.StreamReader..ctor(String path, Encoding encoding)
    at System.IO.File.ReadAllLines(String path, Encoding encoding)
    at ‌‌‏‭‍‭‏‬‎‎‌‭‌‫‬‭‮.get_HasHostsfileEntry()
    at ‌‌‏‭‍‭‏‬‎‎‌‭‌‫‬‭‮.‍‌‎‎‏‫‭‬‍‫‮‬‭‎‮‫‮‌‫‪‌‬‪‭‫‮()
    at ‌‌‏‭‍‭‏‬‎‎‌‭‌‫‬‭‮.‍‪‎‫‬‌‬‮‪‮‪‫‪‪‌‮‏‎‬‮(Object , EventArgs )
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ** Loaded Assemblies **
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8941 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8922 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8941 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8922 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8922 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8922 (WinRelRS4.050727-8900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------

    ** JIT Debugging **
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

    Any help is appreciated.

    :)
     
    gintarasbidva, Aug 22, 2019
    #1
  2. zbook Win User

    Programs not working


    In post 26 there were steps listed to fix the operating system corruption.
    Are you able to follow them?
    In post 29 was the suggested dism repair command.
     
    zbook, Aug 22, 2019
    #2
  3. RCoon Win User
    iOS Help Desk

    This is a thread for quick question-quick answer topics, any questions relating to iOS go here.
    • New update broken your favorite app?
    • Can't find a setting?
    • Emails not coming through properly?
    If you've got any advanced questions, go ahead and make a thread!
     
    RCoon, Aug 22, 2019
    #3
  4. System.IO.FileNotFoundException

    PC Build Steps

    Ok just because I like steps i am going to create some steps. Please give me the stamp of approval/disapproval
    • Install system in case
      • Remember to connect SSD and optical to same SATA ports on motherboard
    • Turn on PC
    • setup HDD
    • run blend test in prime95 for 30-60 min
      • run realtemp at the same time
    • While in Prime95 test
      • if CPU goes above 70c in RealTemp, I have a leaky CPU
      • if my system locks up or blue screens, there is an instability in the system somewhere
      • if my system does not lock up or blue screen, my CPU is not damaged and I am in the clear!
    What do you guys think??
     
    anandsap123, Aug 22, 2019
    #4
Thema:

System.IO.FileNotFoundException

Loading...
  1. System.IO.FileNotFoundException - Similar Threads - System FileNotFoundException

  2. I have Bluescreen system service exception while playing games

    in Windows 10 Drivers and Hardware
    I have Bluescreen system service exception while playing games: I run the windbg and it shows that SYMBOL_NAME: nt!ExpAcquireResourceSharedLite+6ca MODULE_NAME: nt IMAGE_NAME: ntkrnlmp.exe IMAGE_VERSION: 10.0.19041.2251 STACK_COMMAND: .cxr 0xfffff801680ba920 ; kb BUCKET_ID_FUNC_OFFSET: 6ca FAILURE_BUCKET_ID:...
  3. I have Bluescreen system service exception while playing games

    in Windows 10 Gaming
    I have Bluescreen system service exception while playing games: I run the windbg and it shows that SYMBOL_NAME: nt!ExpAcquireResourceSharedLite+6ca MODULE_NAME: nt IMAGE_NAME: ntkrnlmp.exe IMAGE_VERSION: 10.0.19041.2251 STACK_COMMAND: .cxr 0xfffff801680ba920 ; kb BUCKET_ID_FUNC_OFFSET: 6ca FAILURE_BUCKET_ID:...
  4. I have Bluescreen system service exception while playing games

    in Windows 10 Software and Apps
    I have Bluescreen system service exception while playing games: I run the windbg and it shows that SYMBOL_NAME: nt!ExpAcquireResourceSharedLite+6ca MODULE_NAME: nt IMAGE_NAME: ntkrnlmp.exe IMAGE_VERSION: 10.0.19041.2251 STACK_COMMAND: .cxr 0xfffff801680ba920 ; kb BUCKET_ID_FUNC_OFFSET: 6ca FAILURE_BUCKET_ID:...
  5. windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...

    in Windows 10 Gaming
    windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...: windows system c ant' update and cursor keeps skipping ahead when typing any thing i n cluding this message https://answers.microsoft.com/en-us/windows/forum/all/windows-system-c-ant-update-and-cursor-keeps/09df18ba-7994-480b-883e-ce1a0b6ef9a8
  6. windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...

    in Windows 10 Software and Apps
    windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...: windows system c ant' update and cursor keeps skipping ahead when typing any thing i n cluding this message https://answers.microsoft.com/en-us/windows/forum/all/windows-system-c-ant-update-and-cursor-keeps/09df18ba-7994-480b-883e-ce1a0b6ef9a8
  7. windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...

    in Windows 10 BSOD Crashes and Debugging
    windows system c ant' update and cursor keeps skipping ahead when typing any thing i n...: windows system c ant' update and cursor keeps skipping ahead when typing any thing i n cluding this message https://answers.microsoft.com/en-us/windows/forum/all/windows-system-c-ant-update-and-cursor-keeps/09df18ba-7994-480b-883e-ce1a0b6ef9a8
  8. Cant activate my win 11 pro after reinstall the system

    in Windows 10 Gaming
    Cant activate my win 11 pro after reinstall the system: Error 0xC004C003The activation server determined the specified product key is blocked https://answers.microsoft.com/en-us/windows/forum/all/cant-activate-my-win-11-pro-after-reinstall-the/2bfea9d2-94a1-4f48-b37e-18be1890cd94
  9. Cant activate my win 11 pro after reinstall the system

    in Windows 10 Software and Apps
    Cant activate my win 11 pro after reinstall the system: Error 0xC004C003The activation server determined the specified product key is blocked https://answers.microsoft.com/en-us/windows/forum/all/cant-activate-my-win-11-pro-after-reinstall-the/2bfea9d2-94a1-4f48-b37e-18be1890cd94
  10. My system asks my for my own permission and denies it on my behalf

    in Windows 10 Gaming
    My system asks my for my own permission and denies it on my behalf: I didn't know how to explain this, sorry for the confusing title.The thing is that I've been trying to delete my "windows.old" folder for the whole morning now and so far I've been able to go through most security barriers but at this point this is just an error. At first, it...

Users found this page by searching for:

  1. system.io filenotfound exception windows bluescreen

    ,
  2. System.IO.FileNotFoundException 1903