please fix

Stimulsoft Reports.NET discussion
Post Reply
mgholam
Posts: 9
Joined: Tue Jun 03, 2008 12:34 am
Location: -

please fix

Post by mgholam »

"referenced assemblies" only searches for dlls beside the application, please search GAC also before giving error
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

please fix

Post by Edward »

Searching of dlls required for run of .Net Applications is out of our control.
.Net Framework searches always in the GAC and only after that scans folder with the Application.

P.S. Sometimes GAC contains required dlls for application with correct name but version of dlls is different from version which was used in Visual Studio. In such cases no dlls will be found and you'll receive an error about missing dlls.

Thank you.
mgholam
Posts: 9
Joined: Tue Jun 03, 2008 12:34 am
Location: -

please fix

Post by mgholam »

thank you Edward,

but i beg to differ, attached if the reflector code from stimulsoft.base.dll , as you can see you are using Assembly.Load and not Assembly.LoadWithPartialName which checks the GAC.


public static Assembly GetAssembly(string assemblyName)
{
Assembly assembly2;
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(assemblyName);
if ((fileNameWithoutExtension != null) && (fileNameWithoutExtension.Length > 0))
{
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
AssemblyName name = assembly.GetName();
if (fileNameWithoutExtension == name.Name)
{
return assembly;
}
}
}
try
{
assembly2 = Assembly.Load(fileNameWithoutExtension);
}
catch (FileNotFoundException)
{
}
return assembly2;
try
{
if (!fileNameWithoutExtension.ToLower(CultureInfo.InvariantCulture).StartsWith("stimulsoft"))
{
try
{
if (!File.Exists(assemblyName))
{
return null;
}
assembly2 = Assembly.LoadFrom(assemblyName);
}
catch (FileNotFoundException)
{
}
return assembly2;
}
string assemblyQualifiedName = typeof(StiAssemblyFinder).AssemblyQualifiedName;
int index = assemblyQualifiedName.IndexOf(",");
assembly2 = Assembly.Load(assemblyQualifiedName.Substring(index + 1).Replace("Stimulsoft.Base", fileNameWithoutExtension));
}
catch (FileNotFoundException)
{
}
return assembly2;
}




Post Reply