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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:36:04+00:00 2026-06-07T17:36:04+00:00

How do I configure my application so AutoMapper can map to internal types and/or

  • 0

How do I configure my application so AutoMapper can map to internal types and/or properties in Silverlight 5? For example, I have the following type:

internal class SomeInfo
{
    public String Value { get; set; }
}

I try to call Mapper.DynamicMap with this type as the destination and I receive the following error at runtime:

Attempt by security transparent method
‘DynamicClass.SetValue(System.Object, System.Object)’ to access
security critical type ‘Acme.SomeInfo’ failed.

I’ve tried instantiating the class first, then passing the instance to DynamicMap as well as changing the class scope to public with an internal setter for the property. I’ve also marked the class with the [SecuritySafeCritical] attribute. All of these tests resulted in the same error message.

The only way I’ve been able to get past this is to completely expose the class with public scope and public setters. This is, of course, a problem as I am developing a class library that will be used by other developers and using “internal” scope is a deliberate strategy to hide implementations details as well as make sure code is used only as intended (following the no public setters concept from DDD and CQRS).

That said, what can I do to make it so AutoMapper can work with internal types and/or properties?

(Note: The class library is built for SL5 and used in client apps configured to run out-of-browser with elevated trust.)

  • 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-07T17:36:06+00:00Added an answer on June 7, 2026 at 5:36 pm

    This is more of a Silverlight limitation – it does not allow reflection on private/protected/internal members from outside assemblies, see:

    http://msdn.microsoft.com/en-us/library/stfy7tfc(VS.95).aspx

    Simply put – AutoMapper can’t access internal members of your assembly.

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

Sidebar

Related Questions

I am trying to configure an application such that types from assemblyA can be
I'm using log4net for logging (duh!). Using the EventLogAppender, I can configure my application
Can I configure my C# application to limit its memory consumption to, say, 200MB?
I am trying to configure JMX console for my standalone Spring application. I have
I have a windows application (C#) and i need to configure it to run
I have developed a spring application, I want to configure it with apache log4j,
I've a doubt. How can I configure my application to use www.mysite.com/myfolder instead of
I'm trying to configure my application in facebook but I have a trouble. My
I am using Spring @Configuration annotation to configure my application. Currently, I have a
The service layer of my ASP.NET MVC 3 application uses AutoMapper to map view

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.