Exemplo n.º 1
0
        private void ProcessAssembly(string inputFile, IRootingServiceProvider rootProvider)
        {
            EcmaModule assembly;

            try
            {
                assembly = (EcmaModule)_context.ResolveAssembly(new AssemblyName(inputFile), false);
            }
            catch (TypeSystemException.BadImageFormatException)
            {
                // Native files can sometimes end up in the input. It would be nice if they didn't, but
                // it's pretty safe to just ignore them.
                // See: https://github.com/dotnet/corert/issues/2785
                return;
            }

            if (FrameworkStringResourceBlockingPolicy.IsFrameworkAssembly(assembly))
            {
                return;
            }

            rootProvider.RootModuleMetadata(assembly, "Application assembly root");

            foreach (TypeDesc type in assembly.GetAllTypes())
            {
                RdXmlRootProvider.RootType(rootProvider, type, "Application assembly root");
            }
        }
        private void ProcessAssembly(string inputFile, IRootingServiceProvider rootProvider)
        {
            EcmaModule assembly;

            try
            {
                // We use GetModuleFromPath because it's more resilient to slightly wrong inputs
                // (e.g. name of the file not matching the assembly name)
                assembly = _context.GetModuleFromPath(inputFile);
            }
            catch (TypeSystemException.BadImageFormatException)
            {
                // Native files can sometimes end up in the input. It would be nice if they didn't, but
                // it's pretty safe to just ignore them.
                // See: https://github.com/dotnet/corert/issues/2785
                return;
            }

            if (FrameworkStringResourceBlockingPolicy.IsFrameworkAssembly(assembly))
            {
                return;
            }

            rootProvider.RootModuleMetadata(assembly, "Application assembly root");

            foreach (TypeDesc type in assembly.GetAllTypes())
            {
                RdXmlRootProvider.RootType(rootProvider, type, "Application assembly root");
            }
        }
Exemplo n.º 3
0
        private void ProcessAssembly(string inputFile, IRootingServiceProvider rootProvider)
        {
            var assembly = (EcmaModule)_context.ResolveAssembly(new AssemblyName(inputFile), false);

            if (FrameworkStringResourceBlockingPolicy.IsFrameworkAssembly(assembly))
            {
                return;
            }

            rootProvider.RootModuleMetadata(assembly, "Application assembly root");

            foreach (TypeDesc type in assembly.GetAllTypes())
            {
                RdXmlRootProvider.RootType(rootProvider, type, "Application assembly root");
            }
        }