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

  • SEARCH
  • Home
  • 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 597411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:16:39+00:00 2026-05-13T16:16:39+00:00

I am writing a small silverlight app just to try silverlight. My idea is

  • 0

I am writing a small silverlight app just to try silverlight. My idea is to make a small app that checks if websites are online. It works by the user inputting a URL and my app checks it uptime every 5 minutes.

But when ever I do a webrequest I get the security exception below. Reading http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(VS.95).aspx it seems to indicate that silverlight doesn’t allow crossdomain connection. So is there no way to make my idea work in silverlight?

Example code:

     WebRequest testHTTP = null;
            try
            {
                testHTTP = WebRequest.Create(serverToCheck);
            }
            catch (UriFormatException ufe)
            {
                try
                {
                    testHTTP = WebRequest.Create("http://" + serverToCheck);
                }
                catch (UriFormatException ufe1)
                {
                    MessageBox.Show("Invalid server address");

                }
            }
            if (testHTTP != null)
            {
                testHTTP.BeginGetResponse(new AsyncCallback(doCheck), testHTTP); 

                }

  void doCheck(IAsyncResult a)
    {
        try
        {
            HttpWebRequest req = (HttpWebRequest)a.AsyncState;
            HttpWebResponse res = (HttpWebResponse)req.EndGetResponse(a);

             Dispatcher.BeginInvoke(() => HTTPStatus.Content = "OK");

        }
        catch (Exception ex)
        {
  //handle exception
        }

    }

Exception:
{System.Security.SecurityException —> System.Security.SecurityException: Security error.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState)
— End of inner exception stack trace —
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at monitor.Home.doCheck(IAsyncResult a)}

  • 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. Editorial Team
    Editorial Team
    2026-05-13T16:16:40+00:00Added an answer on May 13, 2026 at 4:16 pm

    You can’t override the cross domain policy of the server in Silverlight 3. In Silverlight 4 you can with a trusted “out of browser” application.

    Your best bet is to create a service that runs on the same domain as the one hosting the Silverlight application and have it do the checks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just a beginner in C++. I'm writing small and simple program that prints
I'm writing a small audio application (in Silverlight, but that's not really relevant I
Writing a small app that ( among other things ) lets users upload a
I am writing small app, using Play Framework 2.0 which uses Ebean as ORM.
Coming from a PHP background, I'm used to writing small functions that return a
I am writing a small program that sends and receive multicast packets.I need to
I'm writing a small RMI based Chat application. The idea is: the Client registers
I am writing a small php file that is called via ajax from a
I'm writing a small program using wxPython that displays a finite sized grid of
I'm writing a small Silverlight media player application. In the top of the page

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.