473,761 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 FileIOPermissio n code but to no
avail:

objFilePermissi on = FileIOPermissio n
(Security.Permi ssions.FileIOPe rmissionAccess. AllAccess, sFileName)

objFilePermissi on.Demand()

objStreamReader = New System.IO.Strea mReader(sFileNa me)
*** Bombs right here ***

The error I get is:
Request for the permission of type
System.Security .Permissions.Fi leIOPermission, mscorlib,
Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
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 1437
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******** *************@g 44g2000cwa.goog legroups.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 FileIOPermissio n code but to no
avail:

objFilePermissi on = FileIOPermissio n
(Security.Permi ssions.FileIOPe rmissionAccess. AllAccess, sFileName)

objFilePermissi on.Demand()

objStreamReader = New System.IO.Strea mReader(sFileNa me)
*** Bombs right here ***

The error I get is:
Request for the permission of type
System.Security .Permissions.Fi leIOPermission, mscorlib,
Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
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
7548
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 and some who couldn't but that it wasn't important right now. And I said, 'sure, we can do that later'. So now I've developed an app without any thought to security and am trying to apply it afterwards. Doh!, doh! and triple doh!
1
2389
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 run it on my wifes' machine over the network it fails on the statement:
12
1972
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 StreamWriter(file); sw.Write("Hello"); sw.Close(); file.Close();
19
3223
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 and Everyone, with Full Control to see if it's a permissions problem. The project is hosted in a Windows 2003 Server and developed from PCs in a domain, developing with Visual Studio 2005 Beta 1. -- Regards,
8
1810
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 DirectoryEntry and connect to that machine specifying credentials. That's becauase the running user does not has the right permissions . The application is written in C# and the action taken is done with threads from the threadpool.
2
1046
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 FileIOPermission code but to no avail: objFilePermission = FileIOPermission (Security.Permissions.FileIOPermissionAccess.AllAccess, sFileName)
3
1167
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 not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file. Now, I'm running IIS 5 and I've tried on this...
7
5612
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 the program resides on a network drive then I get the following error. System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,...
5
8331
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 by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: for the permission of type
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.