Solved

Running a DB-based app from a network drive

Posted on 2006-11-01
8
203 Views
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# ?
0
Comment
Question by:Sinclair
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:mnasman
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
0
 
LVL 2

Author Comment

by:Sinclair
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.
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 125 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

Cheers!
0
 
LVL 22

Accepted Solution

by:
mnasman earned 125 total points
ID: 17857464
look at CasPol to help you
CasPol
"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
http://blogs.msdn.com/shawnfa/archive/2004/12/30/344554.aspx

Why Is CasPol Prompting Me For Confirmation?
http://blogs.msdn.com/shawnfa/archive/2005/07/27/443975.aspx
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 2

Author Comment

by:Sinclair
ID: 17860772
emoreau:

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

mnasman:

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 ?
0
 
LVL 69

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.
0
 
LVL 22

Expert Comment

by:mnasman
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 :-)
0
 
LVL 2

Author Comment

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

12 Experts available now in Live!

Get 1:1 Help Now