`

.net - .net 4.0 security model framework v2 and v4 compatibility issues

    博客分类:
  • .net
阅读更多

 

the .net framework has a new security model which is quit different from its ancestor/predecessor/forerunner/antecessor/forebearer....

 

 

In a simple word, every application running from places other than local then it is not trusted. and the caspol does not work anymore.

 

<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>
 

 

 

.NET 4.0 doesn't have CasPol?. If you are running a non-hosted application (launching an exe), it'll be full-trusted, no-matter from where you started it. Sandboxing of assemblies is possible if they are loaded into an explicit host application (office, iis, etc...). If the exe is full-trusted, it wouldn't be safe to load an assembly from the network (afs) without limiting its permissions, that's why it throws this exception.

 

http://msdn.microsoft.com/en-us/magazine/ee677170.aspx

 

You can also enable the caspol settings. and relying on the dist benig full-trusted by default:

 

<configuration>
   <runtime>
      <NetFx40_LegacySecurityPolicy enabled="true"/>
   </runtime>
</configuration>
 

 

 

Without doing so , you may end up having the following error: 

 

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
 

 

Loading mixed mode or managed c++ assemblies fails

 

 

You may need to do this: 

 

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup>
 

 

.NET 4.0 changed the runtime activation policy. Mixed mode and managed c++ assemblies are built with earlier versions of .NET cannot be loaded without the configuration snippet above.

 

http://blogs.msdn.com/b/clrteam/archive/2010/06/23/in-proc-sxs-and-migration-quick-start.aspx

http://msdn.microsoft.com/en-us/magazine/ee819091.aspx

分享到:
评论

相关推荐

    flexmojos-flex3-compatibility-layer-4.0-RC1.zip

    JUnitInstrumentationTestRunner.zip,JUnitInstrumentationTestRunner是Android InstrumentationTestRunner的扩展,它添加了

    sciter-sdk-4.0.3.5348

    [script] await/yield syntax compatibility with JS: await is allowed to be in async function() only, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function ...

    .NET Framework 4类库大全

    ### .NET Framework 4类库概述 .NET Framework 4 是微软发布的一个重要的开发平台,它为开发者提供了大量的类库和工具来构建各种类型的应用程序,包括桌面应用、Web 应用和服务等。本文将详细介绍《.NET Framework ...

    android-cts4.0

    Android CTS(Compatibility Test Suite)是Google为确保Android设备与应用程序之间的兼容性而设计的一套测试框架。在Android系统中,CTS扮演着至关重要的角色,它确保了不同制造商生产的设备在运行Android应用时能...

    Android 4.0 Compatibility Definition

    Security model compatibility ensures that security features like permissions and isolation mechanisms work consistently across devices. ##### 9.1 Permissions Permissions compatibility ensures that ...

    .NET Core Succinctly

    With .NET Core, cross-platform develop is easier and backward compatibility is no problem. Author Giancarlo Lelli guides you through the fundamentals of .NET Core in his latest book, .NET Core ...

    TV Compatibility Test Suite

    TV Compatibility Test Suite (TV CTS) 是一个专为验证Google TV设备而设计的测试套件。它的主要目标是确保每一个Google TV设备都能支持所有由Google TV所支持的应用和功能。TV CTS由两部分组成:测试框架(test ...

    Programming Excel With Vba And .net.chm

    Programming Excel with VBA and .NET Preface Part I: Learning VBA Chapter 1. Becoming an Excel Programmer Section 1.1. Why Program? Section 1.2. Record and Read Code Section 1.3. Change ...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    ** .NET is a comprehensive framework developed by Microsoft that provides a consistent programming model for developers to build a wide range of applications, including web, desktop, and mobile ...

    zxing.dll zxing.net 版本:0.16.4.00

    ZXing,全称为“Zebra Crossing”,在Java平台下广泛使用,而ZXing.Net是其针对.NET Framework的移植版本。该库的核心是ZXing.dll,它是ZXing.Net的主要组件,包含了各种条形码和二维码解码的算法。 ZXing.Net版本...

    1.1.NET FROMWORK 安装

    3. ASP.NET Security Update for .NET Framework 1.1 SP1 在安装完成后,请确认 ASP.NET v1.1 ISAPI Extension 在 IIS 管理员的 ISAPI and CGI Restrictions 中已经被允许。 三、配置 Machine.config 在 .NET 1.1 ...

    .NET Framework 3.5类库

    ### .NET Framework 3.5 类库概览 #### 标题解读 .NET Framework 3.5类库指的是Microsoft为了支持.NET Framework 3.5版本而提供的标准类库集合。这些类库为开发者提供了丰富的API,可以用于构建各种类型的Windows...

    ComponentOne Studio for ASP.NET Wijmo 2012 v3 4/5

    Ensure your UI works in every browser and every device without worrying about compatibility issues. Create interactive charts that render just as well in IE6 as they do on an iPad. Studio for ASP.NET ...

    AccessControl-4.0b2-cp35-cp35m-win32.whl.zip

    标题中的"AccessControl-4.0b2-cp35-cp35m-win32.whl.zip"是一个软件包,特别是一个Python的发行版本。这个名称包含了几个关键信息: 1. **AccessControl**: 这是软件包的名字,很可能是一个用于Python的库,专注于...

    Xenocode Postbuild 2009 for .NET v7.1.343(Updated 2009-10-11)

    2)Converts .NET applications to native binaries that run without the .NET Framework 3)Embeds SQL Server Express databases directly into the application binary 4)Eliminates compatibility errors by ...

    AccessControl-4.0b7-cp27-cp27m-win_amd64.whl.zip

    标题中的"AccessControl-4.0b7-cp27-cp27m-win_amd64.whl.zip"是一个Python软件包的压缩文件,它主要用于实现访问控制功能。在这个名称中,我们可以提取出以下几个关键信息: 1. **AccessControl**:这是软件包的...

    AccessControl-4.0b7-cp37-cp37m-win32.whl.zip

    标题中的"AccessControl-4.0b7-cp37-cp37m-win32.whl.zip"是一个软件包,用于Python环境的访问控制管理。这个包的名称揭示了几个关键信息: 1. **AccessControl**: 这是包的名字,意味着它提供了访问控制的相关功能...

    Xenocode Postbuild 2009 for .NET v7.1.343(Updated 2009-10-14)

    2)Converts .NET applications to native binaries that run without the .NET Framework 3)Embeds SQL Server Express databases directly into the application binary 4)Eliminates compatibility errors by ...

Global site tag (gtag.js) - Google Analytics