I think i have used a quite common pattern:
var result = from a in AppDomain.CurrentDomain.GetAssemblies()
from t in a.GetTypes()
where t.IsDefined(typeof(TAttribute), inherit)
select t;
If i call the code from Program.cs it works.
Also if i call it from a form it works - sometimes, depending on the form. Sometimes it is only throwing an error: Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft ab, wenn Sie weitere Informationen benötigen.
In the details there is the information:
{"Die Datei oder Assembly \"EntityFramework, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.":"EntityFramework, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"}
This is somehow a bit amazing for me. As far as I know we don't use EntityFramework anywhere, only Telerik as ER.
I have done a "findstr /s /i /m entityframework ." in the projekt directories.
Funilly, it has found it in a Sybase dll "SQL Anywhere 12\iAnywhere.Data.SQLAnywhere.v4.0.dll".
okay - that seems a bit like a sybase sql data provider. But so far as I can see we do not need EntityFramework, and the project also works as anticipated.
How can i resolve this issue? Like saying: I want to parse Appdomain, but not some third party dlls. Or is there any way to ignor the error?