473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Security / Permissions problems running over network!

Hi All,

I have a windows app that runs perfectly on my machine, but when I try
to run it over the network it bombs. I get a permissions error.

Here is the code, I even tried adding FileIOPermission code but to no
avail:

objFilePermission = FileIOPermission
(Security.Permissions.FileIOPermissionAccess.AllAc cess, sFileName)

objFilePermission.Demand()

objStreamReader = New System.IO.StreamReader(sFileName)
*** Bombs right here ***

The error I get is:
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.

I even added my entire computer to the FullTrust permission using:
caspol -ag 1. -site myservername FullTrust

I also tried adding modifying the Runtime Security
Policy->Machine->Code Groups->All_Code->LocalIntranet_Zone to FullTrust
as well.

What am I missing here? Can anyone help?

Thanks

Nov 23 '05 #1
2 1413
Hi,

Try caspol -enterprise -addfulltrust yourassembly
Remember you can never give your application right to something the windows
user account does not allow.

Ken
----------------------------------
<le****@hotmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Hi All,

I have a windows app that runs perfectly on my machine, but when I try
to run it over the network it bombs. I get a permissions error.

Here is the code, I even tried adding FileIOPermission code but to no
avail:

objFilePermission = FileIOPermission
(Security.Permissions.FileIOPermissionAccess.AllAc cess, sFileName)

objFilePermission.Demand()

objStreamReader = New System.IO.StreamReader(sFileName)
*** Bombs right here ***

The error I get is:
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.

I even added my entire computer to the FullTrust permission using:
caspol -ag 1. -site myservername FullTrust

I also tried adding modifying the Runtime Security
Policy->Machine->Code Groups->All_Code->LocalIntranet_Zone to FullTrust
as well.

What am I missing here? Can anyone help?

Thanks

Nov 23 '05 #2
Ken Tucker [MVP] wrote:
Hi,

Try caspol -enterprise -addfulltrust yourassembly
Remember you can never give your application right to something the windows
user account does not allow.

I have had a similar trouble with restricted users "Users" o "Guests"
(not power users)
How can I get the "list" of allowed ".NET Permissions" for the current
account? (So that I can know exactly which restriction I am violating,
and decide whether I should change my code or increase the privileges of
the user?

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

116
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data...
1
by: web1110 | last post by:
Hi, I set up my wifes machine to run .NET, some of my stuff runs but not all. First example: I have a windows program that displays environment info. It runs fine on my machine. Whan I...
12
by: Mark | last post by:
Hello, in a simple console application I try to create a file with some code like: FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new...
19
by: Diego F. | last post by:
I think I'll never come across that error. It happens when running code from a DLL that tries to write to disk. I added permissions in the project folder, the wwwroot and in IIS to NETWORK_SERVICE...
8
by: Manfred Braun | last post by:
Hello All! I am writing a management application, which has to access remote machines registry via System.Diagnostics.EventLog.CreateEventSource . For each machine, I connect to, I create a...
2
by: leeedw | last post by:
Hi All, I have a windows app that runs perfectly on my machine, but when I try to run it over the network it bombs. I get a permissions error. Here is the code, I even tried adding...
3
by: CsharpGuy | last post by:
I have an asp.net (C#) web form that needs to run an exe off of a network drive and when i load the page i'm getting the following error message: The application attempted to perform an operation...
7
by: GMiller | last post by:
I am fairly new to .NET programming so this may be a simplistic question. I wrote a C# application that reads and writes files. If the program resides on a local drive everything is fine. If...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.