?
Solved

Running a DB-based app from a network drive

Posted on 2006-11-01
8
Medium Priority
?
207 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 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

Cheers!
0
Industry Leaders: 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

by:
Mohammed Nasman earned 500 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

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!

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

762 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