Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 47569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:08:36+00:00 2026-05-10T16:08:36+00:00

My app uses a WebRequest at certain points to get pages from itself. This

  • 0

My app uses a WebRequest at certain points to get pages from itself.

This shouldn’t be a problem. It actually works fine on the server, which is a ‘shared’ hosting package with Medium trust. Locally, I use a custom security policy based on Medium trust, which includes the following — copied straight from the default Medium trust policy:

 <IPermission   class='WebPermission'   version='1'>     <ConnectAccess>         <URI uri='$OriginHost$'/>     </ConnectAccess> </IPermission> 

The offending line is in a custom XmlRelativeUrlResolver:

public override object GetEntity( System.Uri puriAbsolute, string psRole, System.Type pReturnType ) {     return _baseResolver.GetEntity( puriAbsolute, psRole, pReturnType ); } 

The url being requested is on localhost, in the same application as the requester. Here’s the top of the stack trace.

  at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)    at System.Security.CodeAccessPermission.Demand()    at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)    at System.Net.HttpRequestCreator.Create(Uri Uri)    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)    at System.Net.WebRequest.Create(Uri requestUri)    at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)    at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)    at flow.controls.XmlRelativeUrlResolver.GetEntity(Uri puriAbsolute, String psRole, Type pReturnType) in c:\flow\source\controls\DataTransform.cs:line 105    at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)

Anyone see the problem here?

@Sijin: Thanks for the suggestion. The url that gets sent to the resolver is based on the request URL, and I confirmed in the debugger that accessing the site at 127.0.0.1 yields the same result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:08:36+00:00Added an answer on May 10, 2026 at 4:08 pm

    My ignorance. I didn’t know that the $OriginHost$ token was replaced using the originUrl attribute of the trust level — I thought it just came from the url of the app. I had originally left this attribute blank.

     <trust level='CustomMedium' originUrl='http://localhost/' /> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app uses an API from an external JAR file. This JAR file has
My app uses a simple SQLite database. Everything works fine I can now present
My app uses data from a web server. On a website you can get
My app uses SetSystemTime() to set the PC clock from a GPS source. This
Our app uses the remoteIO (audio-unit) to get audio input from mic, and DSP
My app uses Handler and sendEmptyMessageDelayed to get timed messages that produce debug output.
My app uses a per-user session to allow multiple sessions from the same user
My app uses a WebView widget to load ads from Google AdManager. AdManager gives
My app uses an image 4000x2828 pixels, about 2.9 MB compressed. It runs fine
My app uses a lot of memory. Normally it runs fine, but on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.