Ask a Question related to ASP.NET Security, Design and Development.
-
Roman #1
Security Error When calling assembly.CreateInstance
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.
Roman Guest
-
dynamically load DLL exception when calling Activator.CreateInstance(type, object[])
I am trying to dynamically load a dll which specifies different rules for evalution with the following code. DataRow dr = ds.Tables.Rows; string... -
Problems with assembly security
Hi Folks, I'm using a third-party module in my apllication to create PDFs. Most time the DDL works fine, but sometime I got the following error... -
How Do I get ConfigurationSettings from the calling assembly?
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be... -
Calling a .NET Assembly from an ASP.NET page
Do yoou mean that it calls a method of a class in an assembly? You may want to make the method call run in a separate thread. See the following... -
Calling .NET Assembly from JavaScript...
I have a requirement to call .NET assembly (Custom component) from thin client Page (ASPX). This Assembly talks only TCP/IP with an external server... -
Ram Sunkara [msft] #2
Re: Security Error When calling assembly.CreateInstance
Send complete error stack trace!!!
"Roman" <anonymous@discussions.microsoft.com> wrote in message
news:02e101c3ac55$4a097fc0$a001280a@phx.gbl...> 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.
>
Ram Sunkara [msft] Guest
-
Roman #3
Re: Security Error When calling assembly.CreateInstance
Sorry, I was away yestarday. Here is the stck trace;
StackTrace " at
System.Security.CodeAccessSecurityEngine.CheckHelp er
(PermissionSet grantedSet, PermissionSet deniedSet,
CodeAccessPermission demand, PermissionToken permToken)
at Excel.ApplicationClass.get_Workbooks()
at
Com.Abetelo.Edm.Parsers.EdmBaseParser.AllocateExce lWorkshe
et(String fileName) in c:\documents and settings\keith
sullivan\my documents\aif\presentation - windows
forms\edmparser\edmbaseparser.cs:line 125
at Com.Abetelo.Edm.Parsers.Ess.EdmXslParserEss.Parse
(String fileName) in c:\documents and settings\keith
sullivan\my documents\aif\presentation - windows
forms\edmxslparseress\edmxslparseress.cs:line 116
at Com.Abetelo.Edm.EdmParserManager.Parser(String
fileName) in c:\documents and settings\keith sullivan\my
documents\aif\presentation - windows
forms\edmapplication\edmparsermanager.cs:line 158
at Com.Abetelo.Edm.EdmApplication.Initialize() in
c:\documents and settings\keith sullivan\my
documents\aif\presentation - windows
forms\edmapplication\edmapplication.cs:line 80
at Com.Abetelo.Edm.EdmApplication..ctor(XmlDocument
xplXmlDocument) in c:\documents and settings\keith
sullivan\my documents\aif\presentation - windows
forms\edmapplication\edmapplication.cs:line 58
at Com.Abetelo.Edm.EdmApplication.Main() in
c:\documents and settings\keith sullivan\my
documents\aif\presentation - windows
forms\edmapplication\edmapplication.cs:line 185"
string
message>-----Original Message-----
>Send complete error stack trace!!!
>
>"Roman" <anonymous@discussions.microsoft.com> wrote ininstance>news:02e101c3ac55$4a097fc0$a001280a@phx.gbl...>> 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@"http://localhost/Parsers/Ess/1.0.0.0/EdmXslParserEss.dll>> in this assembly:
>>
>> 1. Assembly name definition
>>
>> AssemblyName assemblyName = new AssemblyName();
>> assemblyName.CodeBase =
>>AssemblyHashAlgorithm.SHA1;>> ";
>> assemblyName.HashAlgorithm =null,>> 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) 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.
>>
>
>.
>Roman Guest
-
Re: Security Error When calling assembly.CreateInstance
Ram,
I am getting out of my mind dealing with this problem.
What do you think I should do.
Roman
Guest



Reply With Quote

