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

Posts: 1
Name: samir issa
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
 
When You Register, These Ads Go Away!
Old 04-24-2008, 12:56 AM Re: File.IO.Permissions Problem
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
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.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-11-2008, 06:33 PM Re: File.IO.Permissions Problem
vividearth's Avatar
Experienced Talker

Posts: 32
Location: London, UK
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

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

vB 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.11163 seconds with 12 queries