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 249185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:24:20+00:00 2026-05-11T21:24:20+00:00

I have an C# application that needs to list a directory ( Directory.GetFiles() )

  • 0

I have an C# application that needs to list a directory ( Directory.GetFiles() ) and also to access one of the files returned. If I run the application locally it doesnt have problem access the network location or the local locations, if I run it from a network share then I get a security exception thrown when accessing the shares.

I found out why this is happening:
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx

However the solutions seem… impractical unless I am misunderstanding it.

1) I can not use the code ( hardly an option )
2) Sign the assemblies and then have whoever is going to use it configure .NET policies to allow it? ( This relies on the person whos going to use it to change one of their policies which I have no say in ??)
3) Change the policy to allow full trust for everything on localintranet ( Not recommended or even possible in my case )

Am I missing something here, none of those choices seem optimal for a stand alone application being pushed onto a network I have no say in. I would have thought doing something as relatively simple as running an application from a network share to list files in a directory wouldnt have required such crazy hoops to jump through to make it work.

Anyone have any thoughts on what I could do in this situation?

  • 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-05-11T21:24:20+00:00Added an answer on May 11, 2026 at 9:24 pm

    These threads will answer you question, I think:

    • Why does my .NET application crash when run from a network drive?
    • Running a C# exe file

    This behaviour is changed in .NET Framework 3.5 SP1, where it defaults to allowing programs running off network shares.

    And yes, it does not feel very practical, but there is unfortunately not much to do about that…

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

Sidebar

Ask A Question

Stats

  • Questions 162k
  • Answers 162k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, a cookie is a cookie. setcookie.html: <script type="text/javascript"> document.cookie… May 12, 2026 at 12:00 pm
  • Editorial Team
    Editorial Team added an answer You shouldn't be mocking out the PolicyManager, you should be… May 12, 2026 at 12:00 pm
  • Editorial Team
    Editorial Team added an answer You can do a sort in the first line after… May 12, 2026 at 12:00 pm

Related Questions

I am writing a C# application that needs to extract data from a ListView
this is my very first post! I'm pretty desperate so I'm going above and
I will try and explain exactly what I want to achieve first. Imagine two
I have an application that has several objects (about 50 so far, but growing).

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.