Forum posts for netmon.exe

Could not load file or assembly or one of its depencencies. The system cannot find the file …

I am working to program (that was written by other people), this program is written in C#, using Visual Studio 2010. Almost everything was fine (except some logical problems) until i tried to rum my program in Release mode instead of Debug mode. This program downloads testing modules (PingTest.dll) and runs in when computer is Idle. Debug version stores all files in running folder while Release version 'installs' into c:UsersMackeAppDataLocalNetMon and re-runs from there (all files needed to run are also storred there). So when i run NetMon.exe it crashes. I've added some try/catch and found an error:

Could not load file or assembly 'CountDow_Idle, version=1.0.0.2, Culture=neutral, PublicKeyToken=null' or one of its depencencies. The system cannot find the file specified.

The part of the code that causes it:
AppDomain aDom = AppDomain.CreateDomain('TestingDomain');
Assembly testAsm = null;

using (FileStream fs = File.Open(TMP_MOD_NAME, FileMode.Open))
{
using (MemoryStream ms = new MemoryStream())
{
byte[] buffer = new byte[1024];
int read = 0;
while ((read = fs.Read(buffer, 0, 1024)) > 0)
ms.Write(buffer, 0, read);

testAsm = aDom.Load(ms.ToArray());
}
}

INetMonTest iTest = null;
foreach (Type type in testAsm.GetExportedTypes())
{
if (type.BaseType.FullName == 'CountDown_Idle.INetMonTest')
{
try
{
iTest = (INetMonTest)aDom.CreateInstanceAndUnwrap(AssemblyName.GetAssemblyName(TMP_MOD_NAME).FullName, type.FullName);
}
catch (Exception ex)
{
MessageBox.Show('AppDomain creation failed: ' + ex.Message);
}
break;
}
}


I've allready looked for correct versions (in AssemblyInfo.cs file)

So maby anyone could help me.
Thanx in advance

View complete forum thread with replies

Other posts related to netmon.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

[Can't figure out]Memory allocation/freeing error (extremely small code)
Could not load file or assembly or one of its depencencies. The system cannot find the file …

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.