开发者

How to prevent FileIOPermissionException(and others) when run .NET application from network drive

开发者 https://www.devze.com 2022-12-12 21:31 出处:网络
My C# application (.NET 3.5 SP1) works very well w开发者_如何学运维hen if execeuted from local drive.

My C# application (.NET 3.5 SP1) works very well w开发者_如何学运维hen if execeuted from local drive.

However, if I run it from a network drive, it execute (IT IS .NET 3.5 SP1), but failed to read a file located on the same network drive, during File.ReadAllText.

If it matter, the folder structure is like the following

\\server\myshare\ABC\app.exe
\\server\myshare\DEF\xxx.txt

I guess this is some security feature applied by .NET, they remove the "execution" limit since SP1 but the rights is not as exactly as a local application, still.

I've search around but I cannot find what's happening and what the limits are if you run it remotely.

It is a CONSOLE APPLICATION with command line argument, if it matter.

0

精彩评论

暂无评论...
验证码 换一张
取 消