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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:37:40+00:00 2026-06-10T00:37:40+00:00

How to inject C# Preprocessor Directives to an interface by Reflection ? Example :

  • 0

How to inject C# Preprocessor Directives to an interface by Reflection ?

Example :
I want to inject #if SILVERLIGHT to any WCF service contract interface.

  • 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-06-10T00:37:41+00:00Added an answer on June 10, 2026 at 12:37 am

    Short answer: you can’t.
    Slightly longer answer: you question doesn’t even make sense in the first place.

    Preprocessor directives are processed before compilation. The result of that processing is the new, modified, source code. That source code then gets compiled.

    For example, if the SILVERLIGHT symbol is not defined at the time of compilation, then the whole code between #if SiLVERLIGHT and #endif will be completely ignored by the compiler as if it wasn’t even there.

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

Sidebar

Related Questions

I want to inject a Log4j Logger (or in case of generality any class)
I want to inject a form and formHandler service into my controller. <services> <service
I want to inject some Json into the Html page returned by the server?
Is it possible to inject an interface into an existing 3rd party class that
I want to inject a type-information to the log-call, like public sealed class Logger
I want to inject the current namepace on my snippet. Does anyone have an
I need to inject a service based on domain property, so far I came
I just want to inject some design patterns into my Java code, but I
When I try to inject the @request into any of my services, I get
How can I inject ALL parameters in a service? I know I can do:

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.