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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:58:05+00:00 2026-05-31T03:58:05+00:00

[assembly: AssemblyCopyright(Copyright © 2009)] is it possible somehow to access functions like DateTime.Now.Year inside

  • 0
[assembly: AssemblyCopyright("Copyright ©  2009")]

is it possible somehow to access functions like DateTime.Now.Year inside the AssemblyInfo class? so as to put in like

[assembly: AssemblyCopyright("Copyright ©  " + DateTime.Now.Year)]

Doing the above will give, DateTime does not exist in the current context

  • 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-31T03:58:06+00:00Added an answer on May 31, 2026 at 3:58 am

    Out of the box, no, but there are 2 options to access .NET functionality against your assembly file.

    The easiest way to do your example would be to use the AssemblyInfo task from the MSBuildExtensionPack.

    Once you have that installed you can use all the methods in that Task, http://www.msbuildextensionpack.com/help/4.0.4.0/index.html, such as the following:

        <Target Name="Version">
        <ItemGroup>
            <AssemblyInfoFiles Include="$(SourcePath)\Code\Properties\AssemblyInfo.cs"/>
        </ItemGroup>
        <MSBuild.ExtensionPack.Framework.DateAndTime TaskAction="Get" Format="yyyy">
            <Output TaskParameter="Result" PropertyName="MyStartTime"/>
        </MSBuild.ExtensionPack.Framework.DateAndTime>
        <MSBuild.ExtensionPack.Framework.AssemblyInfo ComVisible="false" AssemblyInfoFiles="@(AssemblyInfoFiles)" AssemblyBuildNumberType="YearWeekDay" FirstDayOfWeek="Sunday" AssemblyBuildNumber="4" AssemblyCopyright=" Foo Copyright $(MyStartTime)"/>
    </Target>
    

    The other option is to create a custom msbuild task on your own and expose additional functionality that way.

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

Sidebar

Related Questions

Is there a possibility to include the current year via DateTime.Now.Year in the AssemblyInfo.cs-file?
Suppose assembly Assembly1.dll contains 3 classes: Class C1, C2, C3. I want to expose
Situation: Assembly 1 ________________________ ________________________ | Class A | | Class B | |-----------------------|
I would like to know if I can define custom assembly attributes. Existing attributes
In my program, how can I read the properties set in AssemblyInfo.cs: [assembly: AssemblyTitle(My
Assembly.GetEntryAssembly() does not work for web applications. But... I really need something like that.
I have .NET assembly with ComVisible class. Some days ago (I can find that
I have written an assembly in C# to perform all data access for a
Assembly is a language I'd like to learn but still you don't hear often
Assembly 1 namespace Foo { public class Foo { } } Assembly 2 using

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.