Skip to content

Conversation

@petero-dk
Copy link

@petero-dk petero-dk commented Aug 5, 2025

I have a weird error that when adding another custom attribute to a type I keep getting "Could not load type from assembly" it happens first in GetCustomAttributes, and also a few other places.

By simply ignoring the exceptions (not normally something I would recommend) it just seems to work. I have done a few tests and things like TsOptional are not honored, so I have found significant impact of these changes, but the alternative is the project not working at all.

@petero-dk
Copy link
Author

I solved it in a completely different way.

The problem was that one attribute was located in a nuget assembly - that was not loaded correctly.

And one attribute implemented an interface from a nuget assembly - that was not loaded correctly either.

The reason is that for class libraries nuget assemblies are not copied to the bin folder (anymore?)

Setting the property "included assets" : "all" on the package makes it all work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant