B
Brian Richards
Is it possible to run code in an assembly when it's loaded? In my case I
have an assembly that requires that the users path be setup correctly or
GetTypes() will throw an exception. Looking for a work around to just
requiring the user to have the Path environment setup in the calling
application.
class MyAssemblyLoader
{
public Type[] GetTypes(String assemblyName)
{
Assembly assembly = Assembly.Load(assemblyName); //causes code in
assemblyName to run and set Environment path from Assembly.dll.config
return assembly.GetTypes();
}
}
have an assembly that requires that the users path be setup correctly or
GetTypes() will throw an exception. Looking for a work around to just
requiring the user to have the Path environment setup in the calling
application.
class MyAssemblyLoader
{
public Type[] GetTypes(String assemblyName)
{
Assembly assembly = Assembly.Load(assemblyName); //causes code in
assemblyName to run and set Environment path from Assembly.dll.config
return assembly.GetTypes();
}
}