I created a console application to read and manipulate an Excel file. I added reference to the Microsoft Excel 11.0 Object Library.
When I place it in Network Drive and try to run the .exe from my system, it gives error
'That assembly does not allow partially trusted callers.'
I tried to make the Network Drive where my Console Application is placed a trusted location in the .NET Framework 2.0 Configuration Tool, by adding a Child Code Group to the Runtime Security Policy--> Machine -->Code Group -->All_Code --> LocalIntranet_Zone.
In this child code group I selected URL for the condition type and specified the location of my console Application on the network drive.
But still it doesnt work out..I am badly stuck with this problem.. Can anyone help me out please.........
Hi there!
I'm pretty new at this stuff myself.
But maybe what I know can help....your actual console application has a bunch of "evidence" which is used by .NET's security to determine what group it falls into. This means that your application (written by you, which isn't trusted by .NET) is placed into a category that identifies it as Partially Trusted.
You have to assign your application to a Code Group using the .NET Framework Configuration Tool.
I would create a custom Code Group that is set to full trust permissions and then assign your console application to this Code Group.
This means that you'll have to do something like Sign your assembly with a Strong Name and then import its Public Key into the custom Code Group.
You will have to do this through your project's Properties and then recompile it...then go to your custom Code Group and choose Strong Name as the Membership Condition and import the key (which is in your directory with your compiled code) here.
Do you need more clarification than this?
-Frinny