Ejemplo n.º 1
0
        public void LoadFlushedCode(_Assembly assembly)
        {
            ArgumentUtility.CheckNotNull("assembly", assembly);

            var typePipeAttribute =
                (TypePipeAssemblyAttribute)assembly.GetCustomAttributes(typeof(TypePipeAssemblyAttribute), inherit: false).SingleOrDefault();

            if (typePipeAttribute == null)
            {
                throw new ArgumentException("The specified assembly was not generated by the pipeline.", "assembly");
            }

            if (typePipeAttribute.ParticipantConfigurationID != _typeAssembler.ParticipantConfigurationID)
            {
                var message = string.Format(
                    "The specified assembly was generated with a different participant configuration: '{0}'.",
                    typePipeAttribute.ParticipantConfigurationID);
                throw new ArgumentException(message, "assembly");
            }

            _typeCache.LoadTypes(assembly.GetTypes());
        }