Get Assembly name at compile time in Visual Studio

后端 未结 5 955
灰色年华
灰色年华 2021-01-15 06:40

Is there a way to find out the assembly name at design-time (i.e. not using reflection or runtime APIs such as System.Reflection.Assembly.GetEntryAssembly) from within Visua

5条回答
  •  被撕碎了的回忆
    2021-01-15 07:04

    if you are calling the tool via a post/pre-build event, this data is very easy to access.

    Just go to the "project properties->Build Events" tab, then select either "edit pre-build" or "edit post-build", depending on when you want the tool to run. This should bring up an edit window with the ever helpful "Macros >>" button. Press this and you will be given a heap of macros to use and should be pretty much everything you need.

提交回复
热议问题