Return to doc.sitecore.com

Valid for Sitecore 5.3.2, 5.3.1
1.  .NET3.5 and What's New
Prev Next

Introduction

The .NET Framework 3.5 includes updated .NET Framework 2.0 assemblies and provides new version 3.5 assemblies that contain new types. The Microsoft C# and Visual Basic code providers are contained in the .NET Framework 2.0 assemblies but have been updated to support version 3.5 compilers. By default, the updated code providers generate code for version 2.0 compilers. You can use the <providerOption>element to change the target compiler version to 3.5. To do this, specify "CompilerVersion" for the name attribute and "3.5" for the value attribute.

For more information about providerOption please see the following Microsoft link:

http://msdn2.microsoft.com/en-us/library/bb397730.html

web.config changes

To implement these changes in Sitecore CMS you will need to change web.config to add the compiler. The following lines should be added to the <configuration> section.

<system.codedom>

  <compilers>

       <!-- zero or more compiler elements -->

       <compiler

              language="c#;cs;csharp" extension=".cs"

              type="Microsoft.CSharp.CSharpCodeProvider,

              System,

              Version=2.0.3600.0,

              Culture=neutral,

              PublicKeyToken=b77a5c561934e089"

              compilerOptions="/optimize"

              warningLevel="1">

              <providerOption

                     name="CompilerVersion"

                     value="v3.5" />

       </compiler>

  </compilers>

</system.codedom>

Note: It is necessary to ensure that all code that the v3.5 compiler will use should be recompiled at this point.


Prev Next