Moi aussi mon projet compile et se lance, mais j'ai quand même une exception qui est catché
A first chance exception of type 'System.UriFormatException' occurred in System.dll
Le code t'affichait "c'est ok" dans la console?
C'est peut être moi qui ne sais pas corriger, voici le code que j'ai
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
public Window1()
{
InitializeComponent();
Assembly assembly;
DirectoryInfo dir = new DirectoryInfo("Modules");
if (dir.Exists)
{
foreach (FileInfo fi in dir.GetFiles("*.dll"))
{
if (fi.Name.Contains("Module"))
{
try
{
assembly = Assembly.LoadFrom("Modules/" + fi.Name);
Button b = Application.LoadComponent(new Uri("pack://application:,,,/Module;component/Control.xaml", UriKind.Relative)) as Button;
if (b != null)
Console.WriteLine("c'est ok");
}
catch { }
}
}
}
} |
En tout cas, merci de tout ces efforts pour m'aider
Partager