Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / System.ServiceModel.Activation / System / ServiceModel / Activation / ServiceHostFactory.cs / 1305376 / ServiceHostFactory.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Activation { using System.Collections.ObjectModel; using System.Reflection; using System.Runtime.CompilerServices; [TypeForwardedFrom("System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class ServiceHostFactory : ServiceHostFactoryBase { CollectionreferencedAssemblies; public ServiceHostFactory() { this.referencedAssemblies = new Collection (); } internal void AddAssemblyReference(string assemblyName) { this.referencedAssemblies.Add(assemblyName); } public override ServiceHostBase CreateServiceHost(string constructorString, Uri[] baseAddresses) { if (!AspNetEnvironment.Enabled) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.Hosting_ProcessNotExecutingUnderHostedContext("ServiceHostFactory.CreateServiceHost"))); } if (string.IsNullOrEmpty(constructorString)) { throw FxTrace.Exception.Argument("constructorString", SR.Hosting_ServiceTypeNotProvided); } Type type = Type.GetType(constructorString, false); if (type == null) { //config service activation scenario if (this.referencedAssemblies.Count == 0) { AspNetEnvironment.Current.EnsureAllReferencedAssemblyLoaded(); } foreach (string assemblyName in this.referencedAssemblies) { Assembly assembly = Assembly.Load(assemblyName); type = assembly.GetType(constructorString, false); if (type != null) { break; } } } if (type == null) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType(constructorString, false); if (type != null) { break; } } } if (type == null) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.Hosting_ServiceTypeNotResolved(constructorString))); } return CreateServiceHost(type, baseAddresses); } protected virtual ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { return new ServiceHost(serviceType, baseAddresses); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Button.cs
- UInt16Converter.cs
- GlyphElement.cs
- TypeDelegator.cs
- MergePropertyDescriptor.cs
- MimeWriter.cs
- SettingsContext.cs
- OpenFileDialog.cs
- BuildProviderAppliesToAttribute.cs
- SignedXml.cs
- EndpointInfo.cs
- WindowsIdentity.cs
- ClonableStack.cs
- ConfigurationLockCollection.cs
- CroppedBitmap.cs
- OperationPickerDialog.designer.cs
- CriticalExceptions.cs
- WebZone.cs
- MarkedHighlightComponent.cs
- BookmarkResumptionRecord.cs
- DPCustomTypeDescriptor.cs
- DesignerAttribute.cs
- XPathAncestorIterator.cs
- DataRecordInfo.cs
- TypeCollectionDesigner.xaml.cs
- GZipDecoder.cs
- ReachDocumentReferenceCollectionSerializer.cs
- PlaceHolder.cs
- InstanceStore.cs
- SizeAnimation.cs
- Int32KeyFrameCollection.cs
- GroupBoxAutomationPeer.cs
- TabItem.cs
- TypePropertyEditor.cs
- NopReturnReader.cs
- _SslState.cs
- Brushes.cs
- ETagAttribute.cs
- OracleLob.cs
- OdbcConnectionFactory.cs
- XmlQueryOutput.cs
- NameValueSectionHandler.cs
- LogEntry.cs
- WebPartHeaderCloseVerb.cs
- ClickablePoint.cs
- AxisAngleRotation3D.cs
- ImageButton.cs
- ViewBase.cs
- ToolBar.cs
- URLString.cs
- ProtocolsConfigurationHandler.cs
- ArgumentFixer.cs
- CertificateElement.cs
- PerformanceCounterCategory.cs
- SoapIncludeAttribute.cs
- DataSpaceManager.cs
- AttachmentCollection.cs
- BrowserInteropHelper.cs
- MatrixTransform.cs
- ConnectionPoolManager.cs
- FileVersionInfo.cs
- FileDialog.cs
- PrincipalPermission.cs
- XPathNodePointer.cs
- DataControlFieldCollection.cs
- WebPartConnectionCollection.cs
- ScaleTransform.cs
- InfoCardTrace.cs
- OdbcException.cs
- String.cs
- DataRecordInternal.cs
- PropertyFilterAttribute.cs
- BatchParser.cs
- XmlSchemaParticle.cs
- ConsoleEntryPoint.cs
- SafeLibraryHandle.cs
- IdentityModelStringsVersion1.cs
- ScrollItemProviderWrapper.cs
- PointAnimation.cs
- ExpressionValueEditor.cs
- ConfigXmlCDataSection.cs
- LogWriteRestartAreaAsyncResult.cs
- ServiceContractGenerationContext.cs
- PeerNameRecordCollection.cs
- ToolStripRenderEventArgs.cs
- XsltFunctions.cs
- InputMethodStateTypeInfo.cs
- DateTimeStorage.cs
- MethodBuilder.cs
- TypefaceMap.cs
- RMEnrollmentPage1.cs
- Profiler.cs
- ConstructorArgumentAttribute.cs
- EncodingInfo.cs
- EventMappingSettingsCollection.cs
- BinaryMessageEncodingBindingElement.cs
- FamilyTypefaceCollection.cs
- IBuiltInEvidence.cs
- PerformanceCountersElement.cs
- XPathNavigatorKeyComparer.cs