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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:16:45+00:00 2026-06-01T17:16:45+00:00

I have an action being executed inside of a portable area that needs to

  • 0

I have an action being executed inside of a portable area that needs to get information about the Assembly that called it. The portable area is in project Core and is referenced by client app Client.

GetAssembly and GetExecutingAssembly both return the Core assembly:

// Both are Core
assembly = Assembly.GetAssembly(GetType());
assembly = Assembly.GetExecutingAssembly();

My next thought was to use GetCallingAssembly, but that brings back Anonymously Hosted DynamicMethods Assembly.

assembly = Assembly.GetCallingAssembly();

The only other option is GetEntryAssembly, which is just null:

assembly = Assembly.GetEntryAssembly();

What I want to do is get a reference to the Client assembly using the built-in framework. Obviously, I could use some fancy dependency injection or some other less sophisticated method to get that information to this action; however, I’m wondering if there’s a better built-in way to do this.

Clarification: What I’m trying to get here is version information of the client Assembly. I want each client to have access to a VersionInfo partial that lives in the Core area and adds build version information to a rendered page. So, the action in Core needs to know the Assembly that called it so that it can reflect out the version info.

  • 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-01T17:16:47+00:00Added an answer on June 1, 2026 at 5:16 pm

    After much effort and many tears, I’ve determined that DI is going to be the best way to do this. Why?

    Some Info on Portable Areas
    After some research and observation, it appears that portable areas run in their own sub-instance of MVC. My attempt to call a partial view from my portable area lives in the view of my client application:

    @Html.Action("Versions", "Core")
    

    If I pull out a stacktrace at the Version Action in Core, I get:

    Core.Versions()
    at System.Web.Mvc…
    at System.Web.Mvc…
    at ASP._Page_Views_Shared_Layouts__Base_cshtml.Execute()
    at System.Web.Mvc…
    at …

    Since all of the controller code in my Client application has already executed, there’s not even a reference to that assembly in the stack trace any longer. I also tried adding an Assembly arg to the Versions action, a la:

    @Html.Action("Versions", "Core", new { assembly = Assembly.GetExecutingAssembly() })
    

    but the result from that is App_Web_xq4cmhcy, obviously a generated assembly.

    So, really the only option left is to add a DI container that gets initialized in the Global.asax of every client application with the executing assembly, which can then be read by the Core method.

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

Sidebar

Related Questions

I have a specific controller action that is being called twice, which aside from
I have a controller action that is being executed by a link that was
I have an action method that depending on some conditions needs to return a
I have a action on my controller (controller name is 'makemagic') called 'dosomething' that
I have an action that relies on User.Identity.Name to get the username of the
Is there an event that is fired prior to an action method being called
I have two action methods that are conflicting. Basically, I want to be able
I have an action method that takes in two different objects. I am posting
i have an action that return a file content. i added: Response.AddHeader(Content-Disposition, attactment; filename:\
I have an Action that basically adds an item to a cart, the only

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.