有了这3个方法,就可以通过自定义LifetimeManager来实现从HttpContext中取值。

4、如果是在IIS7中的话,需要加上如下:

using System;
using System.Web;
using System.Collections.Generic;

  1. <system.webServer> 
  2.     <validation validateIntegratedModeConfiguration=”false” /> 
  3.     <modules> 
  4.       <remove name=”ScriptModule” /> 
  5.       <add name=”ScriptModule” preCondition=”managedHandler” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  6.     </modules> 
  7.     <handlers> 
  8.       <remove name=”WebServiceHandlerFactory-Integrated” /> 
  9.       <remove name=”ScriptHandlerFactory” /> 
  10.       <remove name=”ScriptHandlerFactoryAppServices” /> 
  11.       <remove name=”ScriptResource” /> 
  12.       <add name=”ScriptHandlerFactory” verb=”*” path=”*.asmx” preCondition=”integratedMode” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  13.       <add name=”ScriptHandlerFactoryAppServices” verb=”*” path=”*_AppService.axd” preCondition=”integratedMode” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  14.       <add name=”ScriptResource” preCondition=”integratedMode” verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  15.     </handlers> 
  16.     <security> 
  17.       <authorization> 
  18.         <add accessType=”Allow” users=”” /> 
  19.         <add accessType=”Allow” users=”?” /> 
  20.       </authorization> 
  21.     </security> 
  22.   </system.webServer> 

在Unity中,从Unity 取得的实例为
Transient。如果你希望使用多线程方式,就需要在组成时使用lifecycle参数,这时候取出的组件就不再是同一个了。在Unity
IOC中,它支持我们对于组件的实例进行控制,也就是说我们可以透明的管理一个组件拥有多少个实例。Unity
IOC容器提供了如下几种生命处理方式:
#
Singleton:一个组件只有一个实例被创建,所有请求的客户使用程序得到的都是同一个实例。
#
Transient:这种处理方式与我们平时使用new的效果是一样的,对于每次的请求得到的都是一个新的实例。
# Custom:自定义的生命处理方式。

2、在system.web的httpHanders和httpModules节结束处分别加入如下:

        private void context_EndRequest(object sender, EventArgs e)
        {
            IDictionary<Type, object> objects =
HttpContext.Current.Items[UNITYOBJECTS]
                as IDictionary<Type, object>;
            if (objects != null)
            {
                foreach (Type key in objects.Keys)
                {
                    if (objects[key] is IDisposable)
                    {
                        ((IDisposable)objects[key]).Dispose();
                    }
                }
                HttpContext.Current.Items.Remove(UNITYOBJECTS);
            }
        }

  1. <sectionGroup name=”system.web.extensions” type=”System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″> 
  2.       <sectionGroup name=”scripting” type=”System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″> 
  3.         <section name=”scriptResourceHandler” type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /> 
  4.         <sectionGroup name=”webServices” type=”System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″> 
  5.           <section name=”jsonSerialization” type=”System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”Everywhere” /> 
  6.           <section name=”profileService” type=”System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /> 
  7.           <section name=”authenticationService” type=”System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /> 
  8.           <section name=”roleService” type=”System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ requirePermission=”false” allowDefinition=”MachineToApplication” /> 
  9.         </sectionGroup> 
  10.       </sectionGroup> 
  11.     </sectionGroup> 

namespace RequestLifeTimeManagerTest
{
    public class EFContainerExtension : UnityContainerExtension  
    {
        protected override void Initialize()
        {
           this.Container.RegisterType<AdventureWorksLTEntities,
AdventureWorksLTEntities>(new
RequestControlledLifetimeManager(typeof(AdventureWorksLTEntities)))
                .Configure<InjectedMembers>()
                   
.ConfigureInjectionFor<AdventureWorksLTEntities>(new
InjectionConstructor());
        }
    }
}

在我练习的过程中,主要遇到的问题是web.config文件对sl的支持,及相关MIME头的添加。

namespace RequestLifeTimeManagerTest
{
    public class UnityHttpModule : IHttpModule
    {
        internal const string UNITYOBJECTS = “UNITYOBJECTS”;
        #region IHttpModule Members

  1. <!–如果您的是3.5的NET Framework的话,可能还需要加上如下:  
  2.         <add assembly=”System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089″ /> 
  3.         <add assembly=”System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  4.         <add assembly=”System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089″ /> 
  5.         <add assembly=”System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089″ /> 
  6.         —> 
  7.         <add assembly=”System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Practices.Unity;

3、在compliation的assemblies节中加入如下:

下面我们来实现Unity集成ADO.NET Entity Framework的工作:

  1. <remove verb=”*” path=”*.asmx” /> 
  2.       <add verb=”*” path=”*.asmx” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  3.       <add verb=”*” path=”*_AppService.axd” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ /> 
  4.       <add verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ validate=”false” /> 
  5.  <add name=”PublishingHttpModule” type=”Microsoft.SharePoint.Publishing.PublishingHttpModule, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” /> 

    public abstract object GetValue();
    public abstract void RemoveValue();
    public abstract void SetValue(object newValue);
}

1、在原文件的configSections中添加一段sectionGroup,如下:

        private IDictionary<Type, object> GetObjectTable()
        {
            IDictionary<Type, object> objects =
HttpContext.Current.Items[RequestLifeTimeManagerTest.UnityHttpModule.UNITYOBJECTS]
                as IDictionary<Type, object>;
            if (objects == null)
            {
                lock (this)
                {
                    if
(HttpContext.Current.Items[RequestLifeTimeManagerTest.UnityHttpModule.UNITYOBJECTS]
== null)
                    {
                        objects = new Dictionary<Type,
object>();
                       
HttpContext.Current.Items[RequestLifeTimeManagerTest.UnityHttpModule.UNITYOBJECTS]
= objects;
                    }
                    else
                    {
                        return
HttpContext.Current.Items[RequestLifeTimeManagerTest.UnityHttpModule.UNITYOBJECTS]
                            as IDictionary<Type, object>;
                    }
                }
            }
            return objects;
        }

AD: 51CTO云计算架构师峰会 抢票进行中!

用在Unity中,如何获取对象的实例及如何销毁对象都是由LifetimeManager完成的,其定义如下
public abstract class LifetimeManager : ILifetimePolicy,
IBuilderPolicy
{
    protected LifetimeManager();

–web.cofig添加对sl的支持:

    }
}

 

        /// <summary>  
        ///   
        /// </summary>  
        /// <param name=”t”></param>  
        public RequestControlledLifetimeManager(Type t)
        {
            this.objectType = t;
        }

练习了一下在SharePoint站点中使用SilverLight,方法当然是创建一个WebPart,然后在其中承载System.Web.UI.SilverlightControls下的Silverlight控件。不过这里面也有不少SilverLight注意事项。

        #endregion

–经过上述处理,应该就可以完成SP中支持SL了。

        }

在SharePoint中使用SilverLight,说起来虽然简单,但是还是折腾了我一些时间:

 

首先,需要将Silverlight程序中产生的xap文件拷贝到您的sp站点可以访问到的地方。然后创建一个webpart,在其中创建Silverlight的实例对象,然后为其指定Source=”****.xap”特别注意的是,SilverLight的运行需要ScriptManager的支持。

 

特别提醒在SharePoint中使用SilverLight注意事项:如果您是网上找的web.config模板的话,特别注意其中的machineKey这个节点,把它改成您原来config值,不然的话,连您的sp站点都挂了。

接下来的事,就加入承载Silverlight的webpart享受了~~~~

但是:您还有可能碰到这个情况:在SL区域点右键已经可以看到silverlight的runtime信息了,可是这个区域却是一片空白??

原因就在于Silverlight中需要使用xap、XAML文件类型

所以必须在IIS中注册xaml和xap的MIME文件类型。打开IIS->站点属性->HTTP头->MIME类型->新建:

扩展名: .xap

MIME类型:xapapplication/x-silverlight

扩展名: .xaml

MIME类型:application/xaml+xml


在SharePoint中使用SilverLight注意事项:最后在啰嗦一下web.config

其中,在vs08中创建sl-application的时候,就会提示您是否创建host站点。选择创建后,看看它的web.config有哪些是运行sl需要的,把它copy到sharepoint的web.config对应位置即可。

在SilverLight程序中,最好不要使用到.NET
3.5下相关的技术,比如linq等,因为.net20(SharePoint07运行在.net20下)不支持这些东东。

复制相关的web.config节的时候,去除.net3.5下的东东即可。还有一个不需要复制的,就是pages节点下的<controls>关于asp:SilverLight等的注册。

其中GetValue方法获取对象实例,RemoveValue方法销毁对象,SetValue方法为对外引用的保存提供新的实例

在SharePoint中使用SilverLight注意事项

        public override void RemoveValue()
        {
            IDictionary<Type, object> objects =
this.GetObjectTable();
            object obj = null;
            if (objects.TryGetValue(this.objectType, out obj))
            {
                ((IDisposable)obj).Dispose();
                objects.Remove(this.objectType);
            }
        }

写一个HttpMoudle,在Request结束的时候回收资源。

// Original file name:
// Generation date: 2008/8/24 10:05:33
namespace RequestLifeTimeManagerTest
{
    using Microsoft.Practices.Unity;

        public override void SetValue(object newValue)
        {
            IDictionary<Type, object> objects =
this.GetObjectTable();
            objects.Add(this.objectType, newValue);
        }
    }
}

}

构造函数注入包含了二种情况,一种是类仅有一个构造函数时,Unity
可以进行自动注入;另一种情况是,类包含多个构造函数时,必须使用 Attribute
或者配置文件指定注入时使用的构造函数。

       <add name=”UnityModule”
type=”RequestLifeTimeManagerTest.UnityHttpModule,RequestLifeTimeManagerTest”/>           
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language=”c#;cs;csharp” extension=”.cs”
warningLevel=”4″ type=”Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″>
                <providerOption name=”CompilerVersion” value=”v3.5″
/>
                <providerOption name=”WarnAsError” value=”false”
/>
            </compiler>
        </compilers>
    </system.codedom>
    <!–
        The system.webServer section is required for running ASP.NET
AJAX under Internet
        Information Services 7.0.  It is not necessary for previous
version of IIS.
    –>
    <system.webServer>
        <validation validateIntegratedModeConfiguration=”false”
/>
        <modules>
            <remove name=”ScriptModule” />
            <add name=”ScriptModule” preCondition=”managedHandler”
type=”System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″
/>
        </modules>
        <handlers>
            <remove name=”WebServiceHandlerFactory-Integrated”
/>
            <remove name=”ScriptHandlerFactory” />
            <remove name=”ScriptHandlerFactoryAppServices” />
            <remove name=”ScriptResource” />
            <add name=”ScriptHandlerFactory” verb=”*” path=”*.asmx”
preCondition=”integratedMode”
type=”System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ />
            <add name=”ScriptHandlerFactoryAppServices” verb=”*”
path=”*_AppService.axd” preCondition=”integratedMode”
type=”System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ />
            <add name=”ScriptResource” preCondition=”integratedMode”
verb=”GET,HEAD” path=”ScriptResource.axd”
type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″
/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding
xmlns=”urn:schemas-microsoft-com:asm.v1″>
            <dependentAssembly>
                <assemblyIdentity name=”System.Web.Extensions”
publicKeyToken=”31bf3856ad364e35″ />
                <bindingRedirect oldVersion=”1.0.0.0-1.1.0.0″
newVersion=”3.5.0.0″ />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name=”System.Web.Extensions.Design”
publicKeyToken=”31bf3856ad364e35″ />
                <bindingRedirect oldVersion=”1.0.0.0-1.1.0.0″
newVersion=”3.5.0.0″ />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

namespace RequestLifeTimeManagerTest
{
    public class RequestControlledLifetimeManager : LifetimeManager
    {
        private Type objectType;

我们定义了一个Unity扩展,在扩展类EFContainerExtension
我们选择了第一个构造函数以及ObjectContext使用RequestControlledLifetimeManager实现ObjectContext的生命周期管理。

    /// <summary>
    /// There are no comments for AdventureWorksLTEntities in the
schema.
    /// </summary>
    public partial class AdventureWorksLTEntities :
global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new AdventureWorksLTEntities object using the
connection string found in the ‘AdventureWorksLTEntities’ section of the
application configuration file.
        /// </summary>
        public AdventureWorksLTEntities() :
                base(“name=AdventureWorksLTEntities”,
“AdventureWorksLTEntities”)
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new AdventureWorksLTEntities object.
        /// </summary>
        public AdventureWorksLTEntities(string connectionString) :
                base(connectionString, “AdventureWorksLTEntities”)
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new AdventureWorksLTEntities object.
        /// </summary>
        public
AdventureWorksLTEntities(global::System.Data.EntityClient.EntityConnection
connection) :
                base(connection, “AdventureWorksLTEntities”)
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();

1、利用Unity的依赖注入,ObjectContext会给我们生成3个构造函数,类似于下面的代码:

        public void Init(HttpApplication context)
        {
            context.EndRequest += new EventHandler(context_EndRequest);

……

        <customErrors mode=”RemoteOnly”
defaultRedirect=”GenericErrorPage.htm”>
            <error statusCode=”403″ redirect=”NoAccess.htm” />
            <error statusCode=”404″ redirect=”FileNotFound.htm”
/>
        </customErrors>
        –>
        <pages>
            <controls>
                <add tagPrefix=”asp” namespace=”System.Web.UI”
assembly=”System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ />
                <add tagPrefix=”asp”
namespace=”System.Web.UI.WebControls” assembly=”System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″
/>
            </controls>
        </pages>
        <httpHandlers>
            <!–<remove verb=”*” path=”*.aspx”/>
            <add verb=”*” path=”*.aspx”
type=”RequestLifeTimeManagerTest.UnityHttpHandlerFactory,
RequestLifeTimeManagerTest”/>–>
            <remove verb=”*” path=”*.asmx” />
            <add verb=”*” path=”*.asmx” validate=”false”
type=”System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ />
            <add verb=”*” path=”*_AppService.axd” validate=”false”
type=”System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ />
            <add verb=”GET,HEAD” path=”ScriptResource.axd”
type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″
validate=”false” />
        </httpHandlers>
        <httpModules>
            <add name=”ScriptModule”
type=”System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ />

        public override object GetValue()
        {
            IDictionary<Type, object> objects =
this.GetObjectTable();
            object obj = null;
            if (objects.TryGetValue(this.objectType, out obj))
            {
                return obj;
            }
            return null;
        }

ObjectContext有多个构造函数,而且ObjectContext的构造函数代码是Visual
Studio
代码生成的,最好的选择是使用配置文件或者使用配置API指定注入时使用的构造函数。下面是使用配置API:

3、web.config中的配置文件内容如下,注意看红色部分:

我要增加一个Request的,一个Request请求一个实例,然后在Request结束的时候,回收资源。
增加一个Resquest级别的LifetimeManager,HttpContext.Items中数据是Request期间共享数据用的,所以HttpContext.Items中放一个字典,用类型为key,类型的实例为value。如果当前Context.Items中有类型的实例,就直接返回实例。
ObjectContext本身是有缓存的,整个Request内都是一个ObjectContext,ObjectContext一级缓存能力进一步利用。

        public void Dispose()
        {
            //clean-up code here.
        }

2、实现RequestControlledLifetimeManager,完成对整个Request内都是一个ObjectContext的对象的生命周期管理:

<?xml version=”1.0″?>
<configuration>
    <configSections>
        <sectionGroup name=”system.web.extensions”
type=”System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″>
            <sectionGroup name=”scripting”
type=”System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″>
                <section name=”scriptResourceHandler”
type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ requirePermission=”false”
allowDefinition=”MachineToApplication” />
                <sectionGroup name=”webServices”
type=”System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″>
                    <section name=”jsonSerialization”
type=”System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ requirePermission=”false”
allowDefinition=”Everywhere” />
                    <section name=”profileService”
type=”System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ requirePermission=”false”
allowDefinition=”MachineToApplication” />
                    <section name=”authenticationService”
type=”System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ requirePermission=”false”
allowDefinition=”MachineToApplication” />
                    <section name=”roleService”
type=”System.Web.Configuration.ScriptingRoleServiceSection,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35″ requirePermission=”false”
allowDefinition=”MachineToApplication” />
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
        <section name=”unity”
type=”Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,
Microsoft.Practices.Unity.Configuration” />
    </configSections>
    <unity>
        <typeAliases>
      <typeAlias alias=”string” type=”System.String, mscorlib”
/>
            <typeAlias alias=”singleton”
type=”Microsoft.Practices.Unity.ContainerControlledLifetimeManager,
Microsoft.Practices.Unity” />
            <typeAlias alias=”transient”
type=”Microsoft.Practices.Unity.TransientLifetimeManager,
Microsoft.Practices.Unity” />
    </typeAliases>
        <containers>  
            <container>
        <types>
          <type
type=”RequestLifeTimeManagerTest.Gateways.IProductGateway,RequestLifeTimeManagerTest”
mapTo=”RequestLifeTimeManagerTest.Gateways.ProductGateway,
RequestLifeTimeManagerTest”>
          </type>
        </types>
        <extensions>
          <add type=”RequestLifeTimeManagerTest.EFContainerExtension,
RequestLifeTimeManagerTest” />
        </extensions>
            </container>
        </containers>
    </unity>
    <appSettings />
    <connectionStrings><add name=”AdventureWorksLTEntities”
connectionString=”metadata=res://*/AdventureWorksModel.csdl|res://*/AdventureWorksModel.ssdl|res://*/AdventureWorksModel.msl;provider=System.Data.SqlClient;provider
connection string="Data Source=GEFF-PC;Initial
Catalog=AdventureWorksLT;Integrated
Security=True;MultipleActiveResultSets=True"”
providerName=”System.Data.EntityClient”
/></connectionStrings>
    <system.web>
        <!–
            Set compilation debug=”true” to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        –>
        <compilation debug=”true”>
            <assemblies>
                <add assembly=”System.Core, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089″ />
                <add assembly=”System.Data.DataSetExtensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089″
/>
                <add assembly=”System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″
/>
                <add assembly=”System.Xml.Linq, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089″ />
            <add assembly=”System.Data.Entity, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089″
/></assemblies>
        </compilation>
        <!–
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        –>
        <authentication mode=”Windows” />
        <!–
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

admin

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注