R
Roman
I don't event know where to begin to solve it. I tried
everything I could find on the net, with no avail. I ma
loading an assembly using http. Here are the steps
leanding to the assembly load and create object instance
in this assembly:
1. Assembly name definition
AssemblyName assemblyName = new AssemblyName();
assemblyName.CodeBase =
@"http://localhost/Parsers/Ess/1.0.0.0/EdmXslParserEss.dll
";
assemblyName.HashAlgorithm = AssemblyHashAlgorithm.SHA1;
assemblyName.VersionCompatibility =
AssemblyVersionCompatibility.SameProcess;
assemblyName.Flags = AssemblyNameFlags.PublicKey;
assemblyName.KeyPair = new StrongNameKeyPair(File.Open
(@"C:\Key.snk", FileMode.Open,
FileAccess.Read));assemblyName.Version = new
System.Version("1.0.0.0");
2. Assambly load
Assembly assembly = AppDomain.CurrentDomain.Load
(assemblyName);
3. Create an object
EdmBaseParser parser = assembly.CreateInstance
(edmLaboratoryModel.Parser, true,
BindingFlags.CreateInstance, null, new object[]{}, null,
null) as EdmBaseParser;
That is where I am getting the "Security Error"
(System.Security.SecurityException).
The object that get created (EdmBaseParser) uses an
introp.Excel which is a local resource. But I am using
strong names so it shouldn't be a problem.
everything I could find on the net, with no avail. I ma
loading an assembly using http. Here are the steps
leanding to the assembly load and create object instance
in this assembly:
1. Assembly name definition
AssemblyName assemblyName = new AssemblyName();
assemblyName.CodeBase =
@"http://localhost/Parsers/Ess/1.0.0.0/EdmXslParserEss.dll
";
assemblyName.HashAlgorithm = AssemblyHashAlgorithm.SHA1;
assemblyName.VersionCompatibility =
AssemblyVersionCompatibility.SameProcess;
assemblyName.Flags = AssemblyNameFlags.PublicKey;
assemblyName.KeyPair = new StrongNameKeyPair(File.Open
(@"C:\Key.snk", FileMode.Open,
FileAccess.Read));assemblyName.Version = new
System.Version("1.0.0.0");
2. Assambly load
Assembly assembly = AppDomain.CurrentDomain.Load
(assemblyName);
3. Create an object
EdmBaseParser parser = assembly.CreateInstance
(edmLaboratoryModel.Parser, true,
BindingFlags.CreateInstance, null, new object[]{}, null,
null) as EdmBaseParser;
That is where I am getting the "Security Error"
(System.Security.SecurityException).
The object that get created (EdmBaseParser) uses an
introp.Excel which is a local resource. But I am using
strong names so it shouldn't be a problem.