I'm making a treeview for a profile finder, and i include a Imaglist object, when i'm including a new image i have an error when i compile:
Error 1 Could not load file or assembly 'file :/ / / C :/ BlackMagic / fasmdll_managed.dll' or one of its dependencies. You attempted to load a program with an incorrect format. Line 163, position 5. C: \ Users \ Sefi \ Desktop \ Synthesis \ Synthesis \ Syntesis.resx 163 5 Synthesis
I tested make te same program with out Blackmagic.dlls and works perfectly, but when i add this, i have the same error O,O!
i think if you make a empty code and only make a imagelist and add a any image and add Blackmagic.dll you have the same error
this is mi code (works pefect with out blackmagic...)
Code:
using System.IO;
namespace Archivos
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string Dir = Application.StartupPath + @"\Profile"; // Obtain rute of program
private void button1_Click(object sender, EventArgs e)
{
treeView1.Nodes.Clear();
TreeNode desktop = new TreeNode();
desktop.Text = "Profile";
desktop.Tag = "Profile";
desktop.ImageIndex = 0;
desktop.SelectedImageIndex = 0;
desktop.Nodes.Add("");
treeView1.Nodes.Add(desktop);
treeView1.Nodes[0].Expand();
}
public TreeNode EnumerateDirectory(TreeNode parentNode)
{
try
{
DirectoryInfo rootDir;
// To fill Desktop
Char[] arr = { '\\' };
string[] nameList = parentNode.FullPath.Split(arr);
string path = "";
if (nameList.GetValue(0).ToString() == "Profile")
{
path = Dir + "\\";
for (int i = 1; i < nameList.Length; i++)
{
path = path + nameList[i] + "\\";
}
rootDir = new DirectoryInfo(path);
}
else
{
rootDir = new DirectoryInfo(parentNode.FullPath + "\\");
}
parentNode.Nodes[0].Remove();
foreach (DirectoryInfo dir in rootDir.GetDirectories())
{
TreeNode node = new TreeNode();
node.Text = dir.Name;
node.Nodes.Add("");
parentNode.Nodes.Add(node);
}
foreach (FileInfo file in rootDir.GetFiles())
{
TreeNode node = new TreeNode();
node.Text = file.Name;
node.ImageIndex = 2;
node.SelectedImageIndex = 2;
parentNode.Nodes.Add(node);
}
}
catch (Exception ex)
{
}
return parentNode;
}
private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
if (e.Node.Nodes[0].Text == "")
{
TreeNode node = EnumerateDirectory(e.Node);
}
}
private void Form1_Load(object sender, EventArgs e)
{
button1_Click(sender, e);
}
}
}