IO.File.CreateText Logon failure

Posted on 2007-08-10
Last Modified: 2013-11-07
Using ASP.Net/VB.Net 2, I am trying to write to a file from a WEB App.
When I use the code -
Dim oWrite As System.IO.StreamWriter
oWrite = IO.File.CreateText(CorrectFileAddress)
I get the following error -
Logon failure: unknown user name or bad password. (Exception from HRESULT: 0x8007052E)

Everything runs fine when on the LocalHost, but when it is deployed to the Live Web Server (IIS6), then I get the error.

Question by:rangemaster
    1 Comment
    LVL 16

    Accepted Solution

    Make sure that the account your service is running on has write access permission to the folder you are attempting to write to. Depending on your server's Configuration/OS, this could be the Network Service account or the ASP.NET account. You can see which user account it is using within the IIS management console.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    ASP.NET MVC Edit ViewModel Data 6 25
    Aspnet xml 2 27
    Program to display an alert on Windows Toolbar 2 35
    Custom auto number 6 29
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now