Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:46:25+00:00 2026-06-02T03:46:25+00:00

In Visual Studio 2008 I just added the following lines to an existing (working)

  • 0

In Visual Studio 2008

I just added the following lines to an existing (working) project:

if (File.Exists(c_szInvoiceFolder + szAttachmentFile))
    File.Delete(c_szInvoiceFolder + szAttachmentFile);
if (File.Exists(c_szApp_DataFolder + szTemplateFile))
   File.Copy(c_szApp_DataFolder + szTemplateFile, c_szInvoiceFolder + szAttachmentFile);

When the code runs the first time, the file is copied as expected.

However, when the code is re-run, I get “Access to the path … is denied” on the delete line.

According to all the documentation I can find, the ASP.NET development server should run as the logged on user. That seems to not be the case here as I can delete the files myself.

Anyone have any ideas why this is happening?

NOTE: this is happening on my laptop when running in the VS Dev environment.

ANOTHER NOTE: Why would I have permission to CREATE and NOT DELETE?

BTW, I have tried to fix this by granting EVERYONE Full Access to the directory. No help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:46:27+00:00Added an answer on June 2, 2026 at 3:46 am

    Found the issue. The original file was ReadOnly so the copy was ReadOnly. Cleared the ReadOnly flag from the original and all works ok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a Database project (.dbproj project file) in Visual Studio 2008, added a
I have a Business Intelligence project in Visual Studio 2008. I have added a
I just converted a project from Visual Studio 2008 to 2010 and all of
I have a visual studio 2008 project in the directory like C:\Users\espl\Desktop\hello\world\helloworld(.sln file) Now
I have just installed Visual Studio 2008 on a Virtual PC to evaluate it
In Visual Studio 2008 Team System, I just ran Code Analysis (from the Analyze
I just installed Visual Studio 2008, and am looking to use the Microsoft Intermediate
I just moved from Visual Studio 2008 to Visual Studio 2010 (final) and noticed one major
Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I
I just upgraded my operating system to Windows 7. Visual Studio 2008 also seems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.