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 7641019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:49:03+00:00 2026-05-31T08:49:03+00:00

In my Silverlight RIA app I can successfully inject an ExceptionHelper class via constructor

  • 0

In my Silverlight RIA app I can successfully inject an ExceptionHelper class via constructor injection:

[InjectionConstructor]
public CDashCatDataService(IExceptionHelper exceptionHelper)
{
  _exceptionHelper = exceptionHelper;
  SetUp();
}

void SetUp()
{
  if (_context == null)
  {
    try
    {
      throw new Exception("this is a test exception");
      _context = new CDASHDomainContext();          
    }
    catch (Exception ex)
    {
      _exceptionHelper.HandleException(ex, string.Format("{0} -> {1}", GetType().FullName, "Setup"));
    }
  }
  Context = _context;
}

The SetUp method successfully logs and handles the test exception.

However, I can’t get this working if I use property injection instead:

[Dependency]
public IExceptionHelper ExceptionHelper { get; set; }

and then using

catch (Exception ex)
    {
      ExceptionHelper.HandleException(ex, string.Format("{0} -> {1}", GetType().FullName, "Setup"));
    }

in the SetUp method. If I use this, the test exception is not logged and handled.

I’m clearly missing something here – any ideas?

  • 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-31T08:49:05+00:00Added an answer on May 31, 2026 at 8:49 am

    I think this is because the ExceptionHelper property is being called from the constructor via the SetUp method and you can’t call injected properties until after the constructor has executed.

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

Sidebar

Related Questions

I use the following code in wcf ria services (Silverlight App): public partial class
I can create new Silverlight App with .NET RIA Services enabled. But when I
I'm setting up an environment for testing a Silverlight app with RIA Services in
I've got a RIA silverlight 4 app with a complex data type as a
I'm working on a Silverlight 3 app with RIA Services. I've got the app
I am building Silverlight LoB app with WCF RIA services. Inorder to implement SL
I have a Silverlight 4 app with RIA services. It's based on Tim Heuer's
I've got a Silverlight 4 RIA Services (SP1) app using Entity Frameworks 4 CTP5.
VS 2010 ,c# silverlight 4, RIA, MVVM light i moved my SL4 app to
How do you access the controls in a WCF RIA generated Silverlight app? I've

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.