Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / CodeDOM / Compiler / RedistVersionInfo.cs / 3 / RedistVersionInfo.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.CodeDom.Compiler { using System; using System.Diagnostics; using System.IO; using System.CodeDom.Compiler; using System.Configuration; using System.Collections.Generic; using Microsoft.Win32; internal static class RedistVersionInfo { internal const String NameTag = "CompilerVersion"; // name of the tag for specifying the version internal const String DefaultVersion = InPlaceVersion; // should match one of the versions below //internal const String LatestVersion = "Latest"; // always bind to the latest version internal const String InPlaceVersion = "v2.0"; // always bind to Whidbey version internal const String RedistVersion = "v3.5"; // always bind to the Orcas version private const string dotNetFrameworkSdkInstallKeyValueV35 = "MSBuildToolsPath"; private const string dotNetFrameworkRegistryPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\3.5"; public static string GetCompilerPath(IDictionaryprovOptions, string compilerExecutable) { string compPath = Executor.GetRuntimeInstallDirectory(); // if provOptions is provided check to see if it alters what version we should bind to. // provOptions can be null if someone does new VB/CSCodeProvider(), in which case // they get the Whidbey behavior. if (provOptions != null) { string versionVal;//, newPath; if (provOptions.TryGetValue(RedistVersionInfo.NameTag, out versionVal)) { switch (versionVal) { //case RedistVersionInfo.LatestVersion: // always run against the latest version of the compiler // newPath = GetOrcasPath(); // if (newPath != null && File.Exists(Path.Combine(newPath, compilerExecutable))) // compPath = newPath; // break; case RedistVersionInfo.RedistVersion: // lock-forward to the Orcas version, if it's not available throw (we'll throw at compile time) compPath = GetOrcasPath(); break; case RedistVersionInfo.InPlaceVersion: // lock-back to the Whidbey version, no-op break; default: compPath = null; break; } } } if (compPath == null) throw new InvalidOperationException(SR.GetString(SR.CompilerNotFound, compilerExecutable)); return compPath; } private static string GetOrcasPath() { // Temporary until the decision is made: // // \Windows\Microsoft.NET\Framework\v3.5.xxxxx\ or // \Windows\WinFX\v3.5\ string dir = Registry.GetValue(dotNetFrameworkRegistryPath, dotNetFrameworkSdkInstallKeyValueV35, null) as string; if (dir != null && Directory.Exists(dir)) { return dir; } return null; } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BrowserCapabilitiesCompiler.cs
- PolicyLevel.cs
- IntPtr.cs
- SqlDataSourceCustomCommandEditor.cs
- adornercollection.cs
- M3DUtil.cs
- SystemResources.cs
- TextTrailingCharacterEllipsis.cs
- PersonalizationAdministration.cs
- RightsManagementPermission.cs
- Size.cs
- CodePropertyReferenceExpression.cs
- BitmapEffectInput.cs
- QueryStringParameter.cs
- Vector3DConverter.cs
- MatrixAnimationUsingKeyFrames.cs
- AnimationLayer.cs
- EventLogEntry.cs
- DataErrorValidationRule.cs
- GeneralTransform3DTo2DTo3D.cs
- JoinSymbol.cs
- SplashScreenNativeMethods.cs
- PhysicalFontFamily.cs
- UTF7Encoding.cs
- XmlTextEncoder.cs
- FormViewUpdatedEventArgs.cs
- GeometryCombineModeValidation.cs
- WebPartEditVerb.cs
- ComponentResourceManager.cs
- CapiNative.cs
- Int32CAMarshaler.cs
- baseshape.cs
- mda.cs
- QueryParameter.cs
- JsonFormatGeneratorStatics.cs
- StrongNameUtility.cs
- KerberosReceiverSecurityToken.cs
- ellipse.cs
- XmlSchemaSubstitutionGroup.cs
- MenuItemStyle.cs
- ADConnectionHelper.cs
- SqlReferenceCollection.cs
- UrlPath.cs
- WizardStepBase.cs
- PolyQuadraticBezierSegment.cs
- DbParameterCollection.cs
- WindowsGraphics.cs
- MemberRelationshipService.cs
- StringInfo.cs
- SqlServer2KCompatibilityCheck.cs
- XmlILStorageConverter.cs
- DescendantOverDescendantQuery.cs
- ItemType.cs
- OptimizerPatterns.cs
- GridLengthConverter.cs
- Int32Rect.cs
- PasswordRecoveryAutoFormat.cs
- OutputCacheSettings.cs
- ObjectRef.cs
- RelationshipConstraintValidator.cs
- CodeArgumentReferenceExpression.cs
- InsufficientExecutionStackException.cs
- ActivityStatusChangeEventArgs.cs
- FixedHyperLink.cs
- SpellerHighlightLayer.cs
- GreenMethods.cs
- GridView.cs
- ContextStaticAttribute.cs
- UpdateManifestForBrowserApplication.cs
- DiscardableAttribute.cs
- PerfService.cs
- DbDataRecord.cs
- RequiredFieldValidator.cs
- FixedSOMPageElement.cs
- StylusButtonCollection.cs
- BinaryObjectInfo.cs
- TdsValueSetter.cs
- DatePickerAutomationPeer.cs
- DiscoveryMessageProperty.cs
- ScriptResourceAttribute.cs
- RijndaelManagedTransform.cs
- PEFileReader.cs
- SymbolMethod.cs
- CodeAccessPermission.cs
- TakeQueryOptionExpression.cs
- HostingEnvironment.cs
- FormatterServices.cs
- ConfigurationElementProperty.cs
- Point.cs
- CultureInfoConverter.cs
- XmlSchemaIdentityConstraint.cs
- SR.cs
- DocumentXPathNavigator.cs
- ImmutablePropertyDescriptorGridEntry.cs
- RegexWriter.cs
- Nullable.cs
- MostlySingletonList.cs
- JumpPath.cs
- _DigestClient.cs
- RowTypeElement.cs