only check exported types so that we don't crash on internal types

This commit is contained in:
Ellpeck 2019-12-01 18:53:21 +01:00
parent 33f5c14583
commit e8e69dc1cc
2 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@
<package>
<metadata>
<id>Contentless</id>
<version>2.0.3</version>
<version>2.0.4</version>
<authors>Ellpeck</authors>
<description>A tool for MonoGame that automatically handles adding assets to the Content Pipeline project</description>
<tags>monogame mono xna content pipeline mgcb builder tool library</tags>

View file

@ -142,7 +142,7 @@ namespace Contentless {
private static IEnumerable<ImporterInfo> GetContentImporters() {
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (var type in assembly.GetTypes()) {
foreach (var type in assembly.GetExportedTypes()) {
var importer = (ContentImporterAttribute) type.GetCustomAttribute(typeof(ContentImporterAttribute), true);
if (importer != null)
yield return new ImporterInfo(importer, type);
@ -152,7 +152,7 @@ namespace Contentless {
private static IEnumerable<string> GetContentProcessors() {
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (var type in assembly.GetTypes()) {
foreach (var type in assembly.GetExportedTypes()) {
var processor = type.GetCustomAttribute(typeof(ContentProcessorAttribute), true);
if (processor != null)
yield return type.Name;