Skip to content

Commit 52b0112

Browse files
committed
NHibernate.Example.Web: Update to .Net 4.0 - this mainly removes a lot of standard stuff from Web.Config. NH-3581.
1 parent 31617f1 commit 52b0112

File tree

2 files changed

+63
-111
lines changed

2 files changed

+63
-111
lines changed

src/NHibernate.Everything.sln

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Test", "NHiberna
6565
EndProject
6666
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "NHibernate.Example.Web", "NHibernate.Example.Web\", "{C5D6EE68-1760-4F97-AD31-42343593D8C1}"
6767
ProjectSection(WebsiteProperties) = preProject
68-
TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
68+
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
6969
ProjectReferences = "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}|NHibernate.dll;"
7070
Debug.AspNetCompiler.VirtualPath = "/NHibernate.Example.Web"
7171
Debug.AspNetCompiler.PhysicalPath = "NHibernate.Example.Web\"
@@ -129,17 +129,16 @@ Global
129129
{7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Any CPU.Build.0 = Release|Any CPU
130130
{7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
131131
{7AEE5B37-C552-4E59-9B6F-88755BCB5070}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
132-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|.NET.ActiveCfg = Debug|.NET
133-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|.NET.Build.0 = Debug|.NET
134-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Any CPU.ActiveCfg = Debug|.NET
135-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Any CPU.Build.0 = Debug|.NET
136-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET
137-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Mixed Platforms.Build.0 = Debug|.NET
138-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|.NET.ActiveCfg = Debug|.NET
139-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|.NET.Build.0 = Debug|.NET
140-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Any CPU.ActiveCfg = Debug|.NET
141-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Mixed Platforms.ActiveCfg = Debug|.NET
142-
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Mixed Platforms.Build.0 = Debug|.NET
132+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|.NET.ActiveCfg = Debug|Any CPU
133+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
134+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
135+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
136+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
137+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|.NET.ActiveCfg = Debug|Any CPU
138+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Any CPU.ActiveCfg = Debug|Any CPU
139+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Any CPU.Build.0 = Debug|Any CPU
140+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
141+
{C5D6EE68-1760-4F97-AD31-42343593D8C1}.Release|Mixed Platforms.Build.0 = Debug|Any CPU
143142
{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Debug|.NET.ActiveCfg = Debug|Any CPU
144143
{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
145144
{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -167,13 +166,13 @@ Global
167166
{4CE16C2F-EFF6-48A4-99BC-8984DCC143FA} = {9BDB5C84-14EC-4384-B423-9E319675B3CA}
168167
{1631B0BA-59AC-4F0D-B300-3F64CC7579C9} = {9BDB5C84-14EC-4384-B423-9E319675B3CA}
169168
{936E50BD-4027-4864-ADE9-423C3FBF7FFB} = {9BDB5C84-14EC-4384-B423-9E319675B3CA}
170-
{094F74CD-2DD7-496F-BC48-A6D357BF33FD} = {28EA2C84-8295-49ED-BC67-803B7778513E}
171169
{92509065-DAEA-4457-8300-C7B64CD0E9F4} = {28EA2C84-8295-49ED-BC67-803B7778513E}
170+
{094F74CD-2DD7-496F-BC48-A6D357BF33FD} = {28EA2C84-8295-49ED-BC67-803B7778513E}
171+
{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4}
172172
{5909BFE7-93CF-4E5F-BE22-6293368AF01D} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD}
173173
{5C649B55-1B3F-4C38-9998-1B043E94A244} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD}
174174
{7AEE5B37-C552-4E59-9B6F-88755BCB5070} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD}
175175
{7C2EF610-BCA0-4D1F-898A-DE9908E4970C} = {094F74CD-2DD7-496F-BC48-A6D357BF33FD}
176-
{446E148D-A9D5-4D7D-A706-BEDD45B2BC7D} = {92509065-DAEA-4457-8300-C7B64CD0E9F4}
177176
EndGlobalSection
178177
GlobalSection(TextTemplating) = postSolution
179178
TextTemplating = 1

src/NHibernate.Example.Web/Web.Config

Lines changed: 50 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,29 @@
88
\Windows\Microsoft.Net\Framework\v2.x\Config
99
-->
1010
<configuration>
11-
<configSections>
12-
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
13-
<!-- Important under Medium Trust -->
14-
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
15-
<!-- Important under Medium Trust -->
16-
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
17-
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
18-
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
19-
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
20-
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
21-
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
22-
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
23-
<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></configSections>
24-
<appSettings/>
25-
<connectionStrings/>
26-
<system.web>
27-
<!--
11+
<configSections>
12+
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" requirePermission="false"/>
13+
<!-- Important under Medium Trust -->
14+
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
15+
<!-- Important under Medium Trust -->
16+
</configSections>
17+
<appSettings/>
18+
<connectionStrings/>
19+
<system.web>
20+
<!--
2821
Set compilation debug="true" to insert debugging
2922
symbols into the compiled page. Because this
3023
affects performance, set this value to true only
3124
during development.
3225
-->
33-
<compilation debug="true">
34-
<assemblies>
35-
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
36-
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
37-
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
38-
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
39-
<!--
26+
<compilation debug="true" targetFramework="4.0"/>
27+
<!--
4028
The <authentication> section enables configuration
4129
of the security authentication mode used by
4230
ASP.NET to identify an incoming user.
4331
-->
44-
<authentication mode="Windows"/>
45-
<!--
32+
<authentication mode="Windows"/>
33+
<!--
4634
The <customErrors> section enables configuration
4735
of what to do if/when an unhandled error occurs
4836
during the execution of a request. Specifically,
@@ -54,74 +42,39 @@
5442
<error statusCode="404" redirect="FileNotFound.htm" />
5543
</customErrors>
5644
-->
57-
<pages enableViewState="false" enableViewStateMac="false">
58-
<controls>
59-
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
60-
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>
61-
<!-- <trust level="Medium" /> -->
62-
<httpModules>
63-
<add name="CurrentSessionModule" type="NHibernate.Example.Web.CurrentSessionModule"/>
64-
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules>
65-
<httpHandlers>
66-
<remove verb="*" path="*.asmx"/>
67-
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
68-
<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"/>
69-
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers></system.web>
70-
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
71-
<bytecode-provider type="null"/><!-- Important under Medium Trust -->
72-
<session-factory>
73-
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider, NHibernate</property>
74-
<property name="connection.connection_string">
75-
Server=(local);initial catalog=nhibernate;Integrated Security=true
76-
</property>
77-
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
78-
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
79-
<property name="current_session_context_class">web</property>
80-
</session-factory>
81-
</hibernate-configuration>
82-
<log4net>
83-
<!-- Define some output appenders -->
84-
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
85-
<layout type="log4net.Layout.PatternLayout,log4net">
86-
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
87-
</layout>
88-
</appender>
89-
<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
90-
<layout type="log4net.Layout.PatternLayout,log4net">
91-
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
92-
</layout>
93-
</appender>
94-
<root>
95-
<priority value="WARN"/>
96-
<appender-ref ref="trace"/>
97-
</root>
98-
</log4net>
99-
<system.codedom>
100-
<compilers>
101-
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
102-
<providerOption name="CompilerVersion" value="v3.5"/>
103-
<providerOption name="WarnAsError" value="false"/></compiler>
104-
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
105-
<providerOption name="CompilerVersion" value="v3.5"/>
106-
<providerOption name="OptionInfer" value="true"/>
107-
<providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
108-
<system.webServer>
109-
<validation validateIntegratedModeConfiguration="false"/>
110-
<modules>
111-
<remove name="ScriptModule"/>
112-
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
113-
<handlers>
114-
<remove name="WebServiceHandlerFactory-Integrated"/>
115-
<remove name="ScriptHandlerFactory"/>
116-
<remove name="ScriptHandlerFactoryAppServices"/>
117-
<remove name="ScriptResource"/>
118-
<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"/>
119-
<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"/>
120-
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
121-
<runtime>
122-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727"><dependentAssembly>
123-
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
124-
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
125-
<dependentAssembly>
126-
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
127-
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>
45+
<pages enableViewState="false" enableViewStateMac="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
46+
<!-- <trust level="Medium" /> -->
47+
<httpModules>
48+
<add name="CurrentSessionModule" type="NHibernate.Example.Web.CurrentSessionModule"/>
49+
</httpModules>
50+
</system.web>
51+
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
52+
<bytecode-provider type="null"/><!-- Important under Medium Trust -->
53+
<session-factory>
54+
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider, NHibernate</property>
55+
<property name="connection.connection_string">
56+
Server=(local);initial catalog=nhibernate;Integrated Security=true
57+
</property>
58+
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
59+
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
60+
<property name="current_session_context_class">web</property>
61+
</session-factory>
62+
</hibernate-configuration>
63+
<log4net>
64+
<!-- Define some output appenders -->
65+
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
66+
<layout type="log4net.Layout.PatternLayout,log4net">
67+
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
68+
</layout>
69+
</appender>
70+
<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
71+
<layout type="log4net.Layout.PatternLayout,log4net">
72+
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
73+
</layout>
74+
</appender>
75+
<root>
76+
<priority value="WARN"/>
77+
<appender-ref ref="trace"/>
78+
</root>
79+
</log4net>
80+
</configuration>

0 commit comments

Comments
 (0)