Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Required permissions cannot be acquired.

Posted on 2006-11-20
4
Medium Priority
?
463 Views
Last Modified: 2008-02-01
My Hosting company had applied a security update has been applied to the wev server that has affected my ASP.NET 2.0 code. They are telling me that "inorder to  my  DLLs will need to be modified to use the AllowPartiallyTrustedCallersAttribute class and republished.


They have provided me with the following link for more details on this attribute.
http://msdn2.microsoft.com/en-us/library/system.security.allowpartiallytrustedcallersattribute(VS.80).aspx 


Can any one advice what exactly  i need to do get this working at my end.


0
Comment
Question by:GSK_DEV
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
alecpotts earned 2000 total points
ID: 17985950
Hi,

Allowing partially trusted callers on all of your code is a huge security risk. You should only use it with caution, and if absolutely necessary....and if you're sure your code is secure enough and has been through a thorough review...! Have they explained to you exactly WHY this is now necessary??

If I were you, I would seriously consider getting a new hosting company...!!

Some info on partial trust code / environments and risks here:

http://blogs.msdn.com/shawnfa/archive/2005/02/04/367390.aspx

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchSecurityConcernsForVisualBasicNETProgrammers.asp

http://msdn2.microsoft.com/en-gb/library/ms182297(VS.80).aspx

(see section on APCTA - Allow Partially Trusted Callers Attribute)
http://channel9.msdn.com/wiki/default.aspx/SecurityWiki.NETFramework2SecurityChecklist

It sounds like they don't really understand what they're a) doing or b) asking of you. If you DO understand all of the risks and everything else and want to go ahead anyway, what you need to do is add the attribute, above your namespace declaration and below your using statements. It's it the System.Security namespace so you'll need that too..

....
using System.Security;

[assembly:AllowPartiallyTrustedCallers]
.....

Some more info here:
http://vishalsreddy.wordpress.com/tag/aspnet/c/

Hope that helps...
Regards
Alec

0
 
LVL 3

Expert Comment

by:alecpotts
ID: 18027649
Hi GSK_DEV,

Any joy with that??

Alec
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Integration Management Part 2
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question