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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:45:23+00:00 2026-06-12T22:45:23+00:00

I have been reading the AssemblyFileVersion using code similar to this but can no

  • 0

I have been reading the AssemblyFileVersion using code similar to this but can no longer use Assembly.GetExecutingAssembly (or any methods in the Assembly namespace) due to security restrictions.

(As an aside – this is the security restrictions imposed by SharePoint Online which does some interrogation of your assembly upon upload and rejects it if you use certain forbidden parts of the framework)

So are there any other ways of getting the Assembly File Version?

I am guessing no, so are there any ways of putting the AssemblyFileVersion attribute from AssemblyInfo.cs into something like a resource file or a constant so it can be accessed at runtime without using GetExectingAssembly?

  • 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-12T22:45:25+00:00Added an answer on June 12, 2026 at 10:45 pm

    This is what I’ve come up with. Fugly but meets goals (single place where AssemblyFileVersion is defined) without any MSBuild tricks to write out AssemblyFileVersion into resource file.

    File : AssemblyInfo.cs

    // General Information about an assembly is controlled through the following 
    // set of attributes. Change these attribute values to modify the information
    // associated with an assembly.
    [assembly: AssemblyTitle("MyProject")]
    ...
    [assembly: AssemblyFileVersion(MyProject.AssemblyInfo.AssemblyFileVersion)]
    
    namespace MyProject
    {
        static internal class AssemblyInfo
        {
            /// <summary>
            /// The AssemblyFileVersion of this web part
            /// </summary>
            internal const string AssemblyFileVersion = "1.0.3.0";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading so many topics here about this, but I could not
I have been reading this blog post and this stack overflow post but I
I have been reading through this similar question and find myself less than satisfied
I have been reading error LNK2019 for ZLib sample code compiling - But was
I have been reading for a while regarding Hibernate but I can't seem to
I have been reading up on this, and it seems that if you use
I have been reading a lot about openFrameworks and Processing, But still can't make
I have been reading conflicting information about the use of #define macros in iOS
I have been reading a lot about QR codes and how the code itself
I have been reading about bcrypt (application perspective). Thinking of using it to store

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.