当从运行一个网络共享,我用抛出以下例外:

大会不允许部分信任的来电。

我应用程序引用两个DLL文件:

  • BitFactory.Logging.dll
  • FileHelpers.dll

我不知道它是哪一个具有问题。

  • AllowPartiallyTrustedCallersAttribute:阅读它,但我没有来源的任何等文件,所以我不能添加的属性的那些DLL文件。

  • CASPOL.EXE:加入我的网络分享使用的一些变化,例如 caspol -machine -addgroup 1. -url \\netserver\netshare\* LocalIntranet 似乎没有什么影响。

我用CASPOL破解之前,与。净3.5,但是,它似乎不能工作。净4.0现在。任何人都可以suggeest,我怎么能绕过这一"部分信任的主叫"检查?

谢谢。

有帮助吗?

解决方案

.净4.0 更改的缺省规则 出于安全的政策。你需要创建或修改 App.config 文件对这个应用程序。

代码的访问权的安全(如配置 CASPOL)是现在忽略通过默认。净4.0.如果你想要启用它,你需要添加以下你 app.config 文件:

<configuration>
   <runtime>
      <!-- enables legacy CAS policy for this process -->
      <NetFx40_LegacySecurityPolicy enabled="true" />
   </runtime>
</configuration>

你可以配置。净4.0以治疗代码网络使用 LoadFrom 作为充分可信的配置以下项目:

<configuration>
   <runtime>
      <!-- Treat assemblies from network locations as fully trusted. -->
      <!-- Caution: Do not point this loaded gun at your foot. -->
      <loadFromRemoteSources enabled="true" />
   </runtime>
</configuration>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top