Why does my .net application require full trust?

后端 未结 7 1032
有刺的猬
有刺的猬 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:12

    It seems my problem is caused by the fact that my assembly is strongly signed.

    Quoted from msdn

    In strong-named assemblies, a LinkDemand is applied to all publicly accessible methods, properties, and events therein to restrict their use to fully trusted callers. To disable this feature, you must apply the AllowPartiallyTrustedCallersAttributeattribute.

    I'm adding the needed attribute to my assembly, and I'll let you know how things turn out :

    [assembly:AllowPartiallyTrustedCallers]
    

    Update : I've added the attribute to my assemblies, but I'm also using some .net assemblies.

    Not all .net assemblies can be used by partially trusted assemblies (here's a list), namely, WCF assemblies (ie System.ServiceModel) is not on the list

    However, Microsoft states that it's possible to use WCF in a partial trust environment (see here)

    I've tried to remove all the unneeded assemblies from my references, I've used the AllowPartiallyTrustedCallers in all my assemblies, and I'm still stucked...

提交回复
热议问题