Solved

Running a DB-based app from a network drive

Posted on 2006-11-01
8
206 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
[X]
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
8 Comments
 
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
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 70

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 22

Accepted Solution

by:
Mohammed Nasman 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
 
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 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.
0
 
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 :-)
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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