Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Running a DB-based app from a network drive

Posted on 2006-11-01
Medium Priority
Last Modified: 2010-05-18
I am developing a C# Windows Forms application that interacts with our Oracle database. The application can be launched from the command line, and it needs to access the command-line parameters. When I run this app locally, it works fine; i.e., when I type "MyApp.exe abc 123", it runs and does the right thing.

However, the ultimate fate of this app is to run from a network-mapped drive (so that everyone in the company can use it). When I copy the app to the network drive, and run it from there, it crashes with a security exception, because it does not receive permissions to access the database.

Is there any way to bypass this problem in a hassle-free way ? So far, I've been experimenting with two different solutions:

1). Create a strong name for my app, and add it manually to the list of approved apps in the .NET Configuration panel. This works, but this procedure is too complex for all our users to follow (and it will become prohibitively time-consuming if I end up installing new apps on each computer every time I develop them).

2). Publish the app to the network drive, using the Publish option in Visual Studio. This works, but I can't figure out how to pass command-line parameters to the app.

Ideally, I'd like the users to be able to run "X:\MyApp.exe abc 123" (where X is the network drive) and have it work without any extra hassle. Is there a way to do this in C# ?
Question by:Sinclair
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 17856178
Do you have oracle client installed in the user clients?
even if your application run from the server, it still need oracle client to be installed and configured in each computer user

Author Comment

ID: 17856215
Yes, Oracle client is installed on all machines. BTW, I get the same security errors when I try to open files from the local drive.
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 500 total points
ID: 17857285
Hi Sinclair,

You need to adjust the security.

Open the Control Panel
Open Administrative tools
Open Microsoft .Net Framework 1.1 Wizards
Click Adjust .Net Security
click Next
Select Local Intranet
Change the level of trust to Full
click next
click Finish

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 22

Accepted Solution

Mohammed Nasman earned 500 total points
ID: 17857464
look at CasPol to help you
"The Code Access Security Policy tool enables users and administrators to modify security policy for the machine policy level, the user policy level, and the enterprise policy level"

Using CasPol to Fully Trust a Share

Why Is CasPol Prompting Me For Confirmation?

Author Comment

ID: 17860772

Is trusting the Local Intranet going to be a security concern of some kind ?


I've used CasPol, and it works, but it seems like I need to authorize every application individually if I go that route. Is this right, or am I missing something ?
LVL 70

Expert Comment

by:Éric Moreau
ID: 17861063
>>Is trusting the Local Intranet going to be a security concern of some kind ?

every applications that you start from the Local intranet zone will be fully trusted.
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 17872380
>>I've used CasPol, and it works, but it seems like I need to authorize every application individually if I go that route. Is this right, or am I missing something ?

yes, CasPol made for jobs like this :-)

Author Comment

ID: 17883102
Thanks guys, I think I'm going to use CasPol internally, though emoreau's solution is good too.

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 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