G
Guest
here is a DLL I need to mimic because the application does not connect to
real hardware depending on where the application runs ( it runs in a
simulation mode ).
The application ( C#.exe ) -> HeatDrivers.DLL ( the hardware one ) and
application ( C# .exe) -> HeatDrivers.DLL ( has a restricted simulation stub
). Also I should note these are static classes
By an input file I would redirect the application to load the applicable DLL
( locations are different ). Without using an interface class I called /
loaded each DLL - althought I could see all the classes/methods the load was
flawed, because an internal error was generated. this is the simplified DLL :
using System;
using System.Collections.Generic;
using System.Text;
namespace FTEE.HeatDrivers
{
public static class CartInfo
{
public static string ExecRev
{
get
{
string _ExecRev = "TMS Simulation stub";
return _ExecRev;
}
}
}
}
This is the calling piece from the EXE :
Assembly a = Assembly.LoadFrom(heatDriversPath);
Type[] types = a.GetTypes();
foreach (Type typ in types)
{
// ERRORS here ! < why is that ?? >
'typ.DeclaringMethod' threw an exception of type
'System.InvalidOperationException'
'typ.GenericParameterAttributes' threw an exception of type
'System.InvalidOperationException'
'typ.GenericParameterPosition' threw an exception of type
'System.InvalidOperationException'
}
Again Thank you for you effort & time
real hardware depending on where the application runs ( it runs in a
simulation mode ).
The application ( C#.exe ) -> HeatDrivers.DLL ( the hardware one ) and
application ( C# .exe) -> HeatDrivers.DLL ( has a restricted simulation stub
). Also I should note these are static classes
By an input file I would redirect the application to load the applicable DLL
( locations are different ). Without using an interface class I called /
loaded each DLL - althought I could see all the classes/methods the load was
flawed, because an internal error was generated. this is the simplified DLL :
using System;
using System.Collections.Generic;
using System.Text;
namespace FTEE.HeatDrivers
{
public static class CartInfo
{
public static string ExecRev
{
get
{
string _ExecRev = "TMS Simulation stub";
return _ExecRev;
}
}
}
}
This is the calling piece from the EXE :
Assembly a = Assembly.LoadFrom(heatDriversPath);
Type[] types = a.GetTypes();
foreach (Type typ in types)
{
// ERRORS here ! < why is that ?? >
'typ.DeclaringMethod' threw an exception of type
'System.InvalidOperationException'
'typ.GenericParameterAttributes' threw an exception of type
'System.InvalidOperationException'
'typ.GenericParameterPosition' threw an exception of type
'System.InvalidOperationException'
}
Again Thank you for you effort & time