Why does my .net application require full trust?

后端 未结 7 1011
有刺的猬
有刺的猬 2020-12-31 08:58

I\'ve developed a .net 3.0 application, which is deployed using clickonce.

I\'d like to move from full trust to partial trust to ease deployment.

I\'ve tried

7条回答
  •  一向
    一向 (楼主)
    2020-12-31 09:17

    Your stack-trace does not show the type of permission being demanded.

    AllowPartiallyTrustedCallers won't help you in this case. It should be specified on the calling target, e.g. when some partially trusted code calls into your trusted assembly. In your situation you should examine whether your app calls into assemblies that do not have this attribute defined. If yes then your app will need to run in full-trust and won't work in partial trust at all (this is how CAS is enforced and is by design.)

    Otherwise use permcalc. It will show you the permissions that should then be enabled in the security settings of the project. However I'm not sure if after including all those perms you will still have "partial trust" or rather full trust with a few stripped-down permissions. This is due to the fact that partial trust is very restrictive (open security.config and look at the enabled permissions!), as far as I know WebPermission is not there (which is needed to send http requests), same with FileIOPermission.

提交回复
热议问题