Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
File.IO.Permissions Problem
Old 04-23-2008, 06:42 PM File.IO.Permissions Problem
Junior Talker

Posts: 1
Name: samir issa
Trades: 0
I am trying to convert a Windows Forms solution to a web application, i.e. I am trying to integrate the Windows app with a web application project that is being set as the default project. The problem I am facing is that I am getting an exception every time the Windows solution classes try to write on the hard disk or create directories. Those functions were running normally under the Windows app; it is enough that I change the default project to that of the Windows forms application to get the code functioning normally again.
I tried adding File.IO.Permissions at the level of assemblies and classes and still I am not able to get this to work!!
Any ideas??
samirissa is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-24-2008, 01:56 AM Re: File.IO.Permissions Problem
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
The winform app is almost certainly running under the security context of whoever is logged into the computer or network. You, a lot of the time. The webform code runs as whatever user IIS runs as, probably network service. Your best bet is probably to grant that user permission to the folders it needs to operate on. You could change the user for your application, instead, but that carries some risk; if someone hacks your app, they can get more privileged access to the server.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-11-2008, 07:33 PM Re: File.IO.Permissions Problem
vividearth's Avatar
Experienced Talker

Posts: 33
Location: London, UK
Trades: 0
Have you looked at Impersonation yet? This could help:

http://www.netomatix.com/ImpersonateUser.aspx
vividearth is offline
Reply With Quote
View Public Profile Visit vividearth's homepage!
 
Reply     « Reply to File.IO.Permissions Problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24312 seconds with 12 queries