views:

252

answers:

2

I have created an application that can save data both local drive and isolated storage. Then I have tested it by deploying via ClickOnce with FullTrust. This worked correctly, but when I set it to PartialTrust (Internet zone), the application cannot start up.

How to solve this problem?

Thanks, Ek

Add Information #1: I have tried to create empty form windows application and then deploy using PartialTrust, it still errors when I run the application.

+1  A: 

ClickOnce applications do not need full trust permissions to write to isolated storage. However, applications do need full trust for regular file I/O. So I'm guessing that your application will have to request full trust to work.

However, I'm not sure why your empty application won't work with partial trust. What error message do you get?

whatknott
Exception message is "Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." I have no idea why I have issue with this problem, I have tried to search on google and msdn but found nothing about this issue.
In The Pink
A: 

Are you using the SaveFileDialog? From memory, this throws a UIPermission exception for a partial-trust ClickOnce app deployed from the Internet zone. If that's what is happening, you need to change your app deployment to request this specific permission.

UPDATE: If you do a debug build, the exception stack trace will give the line number that caused the security exception.

RoadWarrior
No, I have created new Window Form (File -> New -> Project -> Window Form) then deploy it as ClickOnce (PartialTrust) and it can't even debug the application.
In The Pink
There are ways to debug ClickOnce. My advice would be to ask a separate SO question about ClickOnce debugging if you want some good answers.
RoadWarrior
BTW, if you do a debug build, the exception stack trace will show you the line number that caused the exception.
RoadWarrior