Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security Exception with HttpWebRequest 1

Status
Not open for further replies.

theoryofben

IS-IT--Management
Aug 25, 2001
149
US
Hello All

I have developed an app which needs to process credit cards through authorize.net

I'm using httpwebrequest method (vb.net). All works well on the development machine. But when I upload to server (network solutions), I get the following error:

Code:
Exception Details: System.Security.SecurityException: Request for the permission of type System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Is this a security setting on the server that must be changed or can it be fixed in code? This is my first use of httpwebrequest, so I'm not familiar with the security considerations. If someone could point me in the right direction, I would greatly appreciate it.

Thank in advance.

________________________________________________
[sub]"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison[/sub]

 
It's probably a security setting that needs changing. The WebRequest is demanding a WebPermission which I believe requires medium trust for your app (or folder permissions/ special configuration).
 
That's what I was thinking. But Network Solutions "tech support" acted like I was speaking some other language. I'm guessing they are not going to make the adjustment.

Thanks for the input. When I find out for sure, I'll post the answer.

________________________________________________
[sub]"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison[/sub]

 
Try configuring the trust level in your web.config file and see what blows up:

Code:
<system.web>
   <trust level="Low" />
</system.web>

If you're just using a WebRequest, I know Discount ASP.NET is configured to allow its use. I just implemented a solution using the class the other day.
 
Dude, You Rock!!

I put this in
Code:
<system.web>
  <trust level="High" />
</system.web>

And it works on the server now. I had no idea you could set the trust level like that.

Thank You.

________________________________________________
[sub]"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison[/sub]

 
Your host let you set the trust level?!? [lol]

Good for you man! Happy to help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top